diff --git a/main.c b/main.c index 65e2a68..0411551 100644 --- a/main.c +++ b/main.c @@ -962,6 +962,7 @@ VNA_SHELL_FUNCTION(cmd_menu) } uint8_t remote_text = false; +uint8_t keypad_open = false; // set by ui.c while the sweep thread waits for keypad input VNA_SHELL_FUNCTION(cmd_text) { if (argc!= 1) @@ -3212,6 +3213,11 @@ static void VNAShell_executeLine(char *line) return; } #endif + // The sweep thread stays in an open keypad until it closes: answer at once instead of a 20 s timeout + if ((cmd_flag & CMD_WAIT_MUTEX) && keypad_open) { + shell_printf("keypad active" VNA_SHELL_NEWLINE_STR VNA_SHELL_PROMPT_STR); + return; + } if (cmd_flag & CMD_WAIT_MUTEX) { chSysLock(); shell_function = scp->sc_function; diff --git a/ui.c b/ui.c index 495334a..22d66a3 100644 --- a/ui.c +++ b/ui.c @@ -8106,6 +8106,7 @@ keypad_apply_touch(void) extern uint8_t in_menu_command; extern uint8_t remote_text; +extern uint8_t keypad_open; static void ui_process_keypad(void) @@ -8127,6 +8128,7 @@ ui_process_keypad(void) else draw_numeric_input(kp_buf); } + keypad_open = true; // shell commands for the sweep thread are refused now while (TRUE) { status = btn_check(); if (status & (EVT_UP|EVT_DOWN)) { @@ -8160,6 +8162,7 @@ ui_process_keypad(void) break; } } + keypad_open = false; kp_help_text = NULL; redraw_frame(); if (current_menu_is_form()) {