diff --git a/main.c b/main.c index 0767e9c..6a725bc 100644 --- a/main.c +++ b/main.c @@ -337,7 +337,9 @@ static THD_FUNCTION(Thread1, arg) } #endif #ifdef __UI_OFF__ - if (ui_off && !shell_check_connect()) { // an unplugged tinySA must not stay blind + // An unplugged tinySA must not stay blind. The USB suspend also stops the endless sweep of + // an output mode (usbcfg.c), else this would only run after the next touch or command. + if (ui_off && !shell_check_connect()) { set_ui(true); ui_on_notice = false; // no PC to tell } diff --git a/usbcfg.c b/usbcfg.c index 7333816..b5f4387 100644 --- a/usbcfg.c +++ b/usbcfg.c @@ -422,6 +422,12 @@ static void usb_event(USBDriver *usbp, usbevent_t event) { /* Disconnection event on suspend.*/ sduDisconnectI(&SDU1); +#ifdef __UI_OFF__ + /* ui off: the sweep loop gives the UI back without the PC, but an output mode + keeps sweeping until an operation is requested.*/ + if (ui_off) + operation_requested |= OP_CONSOLE; +#endif chSysUnlockFromISR(); return;