AP_Scripting: Reduce the sleep time with no scripts

Lowering the sleep time when no scripts are pending, causes starting a
REPL session to respond much faster (this cuts the latency from up to 10
seconds to 1 second before the session is ready to start).

Also lowers the default scripting debug level to hide the statustext
from users, as in the general case this is just a spammy message if it
occurs, and we should be finding better reporting bits to get this to
the user.
This commit is contained in:
Michael du Breuil
2020-02-19 13:24:23 -07:00
committed by WickedShell
parent 13f2320138
commit d7a59bc449
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -368,8 +368,6 @@ void lua_scripts::run(void) {
return;
}
lua_atpanic(L, atpanic);
// luaL_openlibs(L);
// load_lua_bindings(L);
load_generated_bindings(L);
// Scan the filesystem in an appropriate manner and autostart scripts
@@ -430,8 +428,10 @@ void lua_scripts::run(void) {
lua_gc(L, LUA_GCCOLLECT, 0);
} else {
gcs().send_text(MAV_SEVERITY_DEBUG, "Lua: No scripts to run");
hal.scheduler->delay(10000);
if (_debug_level > 0) {
gcs().send_text(MAV_SEVERITY_DEBUG, "Lua: No scripts to run");
}
hal.scheduler->delay(1000);
}
}