Smoother console input

This commit is contained in:
fvanroie 2021-02-04 18:30:48 +01:00
parent e23a17c09e
commit 7df826d2de

View File

@ -686,22 +686,23 @@ void debugLvglLogEvent(lv_log_level_t level, const char * file, uint32_t line, c
void IRAM_ATTR debugLoop(void) void IRAM_ATTR debugLoop(void)
{ {
int16_t keypress = debugConsole.readKey(); int16_t keypress;
do {
switch(keypress = debugConsole.readKey()) {
switch(keypress) { case ConsoleInput::KEY_PAGE_UP:
dispatch_page_next();
break;
case ConsoleInput::KEY_PAGE_UP: case ConsoleInput::KEY_PAGE_DOWN:
dispatch_page_next(); dispatch_page_prev();
break; break;
case ConsoleInput::KEY_PAGE_DOWN: case(ConsoleInput::KEY_FN)...(ConsoleInput::KEY_FN + 12):
dispatch_page_prev(); haspSetPage(keypress - ConsoleInput::KEY_FN - 1);
break; break;
}
case(ConsoleInput::KEY_FN)...(ConsoleInput::KEY_FN + 12): } while(keypress != 0);
haspSetPage(keypress - ConsoleInput::KEY_FN - 1);
break;
}
} }
void printLocalTime() void printLocalTime()
{ {