diff --git a/changelog.txt b/changelog.txt index cd50f04..6114a33 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +V1.4266 2026-10-29 For all tinySA models +- Fixed a console command sent right after "output", "modulation" or a touch (e.g. by a script) hanging in output mode until "Command timeout" after 20 s + V1.4263 2026-10-28 For all tinySA Ultra models - PRESET > STORE > STORE 1-4 prefills the name keypad with the name of the active preset (the SD file it was loaded from, else the name it was stored under), so a single ENTER keeps it diff --git a/main.c b/main.c index fe79846..f31eb18 100644 --- a/main.c +++ b/main.c @@ -268,6 +268,9 @@ static THD_FUNCTION(Thread1, arg) chSysLock(); local_func = shell_function; shell_function = 0; + // The shell sets OP_CONSOLE together with shell_function, a request without a + // command (direct command, timed out command) has done its job: the sweep stopped + operation_requested &= ~OP_CONSOLE; chSysUnlock(); if (local_func) { @@ -3255,7 +3258,9 @@ static void VNAShell_executeLine(char *line) #else if (dirty) { #endif - operation_requested = true; // ensure output is updated + chSysLock(); + operation_requested |= OP_CONSOLE; // ensure output is updated: stop the sweep, not a lever event + chSysUnlock(); if (MODE_OUTPUT(setting.mode)) draw_menu(); // update screen if in output mode and dirty else diff --git a/si4432.c b/si4432.c index f7b8215..2661a02 100644 --- a/si4432.c +++ b/si4432.c @@ -755,7 +755,9 @@ void SI4432_Listen(int s) uint16_t sel = SI_nSEL[SI4432_Sel]; uint8_t max = 0; uint16_t count = 0; - operation_requested = OP_NONE; + chSysLock(); + operation_requested &= ~(OP_LEVER|OP_TOUCH); // keep a console request, its command is waiting + chSysUnlock(); do { uint8_t v; palClearPad(GPIOC, sel); diff --git a/si4468.c b/si4468.c index e7aaf44..fe71385 100644 --- a/si4468.c +++ b/si4468.c @@ -2132,7 +2132,9 @@ void SI4432_Listen(int s) (void) s; uint8_t max = 0; uint16_t count = 0; - operation_requested = OP_NONE; + chSysLock(); + operation_requested &= ~(OP_LEVER|OP_TOUCH); // keep a console request, its command is waiting + chSysUnlock(); // SI4463_WAIT_CTS; // Wait for CTS do { uint8_t v = Si446x_readRSSI(); diff --git a/ui.c b/ui.c index b868827..ae503ad 100644 --- a/ui.c +++ b/ui.c @@ -8687,14 +8687,20 @@ ui_process(void) selection = -1; // hide keyboard mode selection ui_mode_menu(); } + // Clear only the handled request: the shell may have set OP_CONSOLE meanwhile for a + // waiting command, without it an output mode sweep never stops to run that command if ((operation_requested&OP_LEVER) || previous_button_state != button_state) { ui_process_lever(); previous_button_state = button_state; - operation_requested = OP_NONE; + chSysLock(); + operation_requested &= ~OP_LEVER; + chSysUnlock(); } if (operation_requested&OP_TOUCH) { ui_process_touch(); - operation_requested = OP_NONE; + chSysLock(); + operation_requested &= ~OP_TOUCH; + chSysUnlock(); } touch_start_watchdog(); }