mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-02-08 04:26:04 +08:00
AP_Scripting: avoid DEV_PRINTF for initial memory usage
This corrupts other MAVLink messages going out at the same time, particularly in CI, causing tests to fail because scripting restart and script initial startup messages are destroyed. Instead use a MAVLink debug statustext, but only send it if the runtime measurement debug bit is on to avoid an obvious change in behavior and unnecessary appearance of a new message.
This commit is contained in:
committed by
Andrew Tridgell
parent
72b4baab8b
commit
4a7ddf545a
@@ -519,10 +519,11 @@ void lua_scripts::run(void) {
|
||||
lua_setmetatable(L, -2); /* set table as metatable for strings */
|
||||
lua_pop(L, 1); /* pop dummy string */
|
||||
|
||||
#ifndef HAL_CONSOLE_DISABLED
|
||||
const int loaded_mem = lua_gc(L, LUA_GCCOUNT, 0) * 1024 + lua_gc(L, LUA_GCCOUNTB, 0);
|
||||
DEV_PRINTF("Lua: State memory usage: %i + %i\n", inital_mem, loaded_mem - inital_mem);
|
||||
#endif
|
||||
if (option_is_set(AP_Scripting::DebugOption::RUNTIME_MSG)) {
|
||||
const int loaded_mem = lua_gc(L, LUA_GCCOUNT, 0) * 1024 + lua_gc(L, LUA_GCCOUNTB, 0);
|
||||
GCS_SEND_TEXT(MAV_SEVERITY_DEBUG, "Lua: State memory usage: %i + %i\n",
|
||||
inital_mem, loaded_mem - inital_mem);
|
||||
}
|
||||
|
||||
// Scan the filesystem in an appropriate manner and autostart scripts
|
||||
// Skip those directores disabled with SCR_DIR_DISABLE param
|
||||
|
||||
Reference in New Issue
Block a user