don't lowercase console commands (#2664)

* don't lowercase commands

* print bool lua results

* lua memory command
This commit is contained in:
Matthew Kennedy 2021-05-10 08:30:50 -07:00 committed by GitHub
parent 13ecc35af7
commit 6cc7b0eeec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -159,6 +159,8 @@ void doInteractive(LuaHandle& ls) {
efiPrintf(TAG "interactive returned number: %f", lua_tonumber(ls, -1));
} else if (lua_isstring(ls, -1)) {
efiPrintf(TAG "interactive returned string: '%s'", lua_tostring(ls, -1));
} else if (lua_isboolean(ls, -1)) {
efiPrintf(TAG "interactive returned bool: %s", lua_toboolean(ls, -1) ? "true" : "false");
} else if (lua_isnil(ls, -1)) {
efiPrintf(TAG "interactive returned nil.");
} else {
@ -248,6 +250,11 @@ void startLua() {
interactivePending = true;
});
addConsoleAction("luamemory", [](){
float pct = 100.0f * memoryUsed / LUA_HEAP_SIZE;
efiPrintf("Lua memory: %d / %d bytes = %.1f%%", memoryUsed, LUA_HEAP_SIZE, pct);
});
}
#else // not EFI_UNIT_TEST

View File

@ -129,7 +129,7 @@ public class AnyCommand {
listener.onSend();
int timeout = CommandQueue.getTimeout(cmd);
reentrant = true;
uiContext.getCommandQueue().write(cmd.toLowerCase(), timeout);
uiContext.getCommandQueue().write(cmd, timeout);
reentrant = false;
}