ui off: an unplugged USB cable gives the UI back, also in an output mode (Ultra)

On the bench unplugging the generator left the UI off until the jog was
pressed. The USB state check was right (an ST-Link monitor showed
USB_SUSPENDED for the whole unplug), but an output mode repeats its sweep
until an operation is requested, so the sweep loop never got to the check.
The USB suspend event now requests one (OP_CONSOLE) while the UI is off.
main
erikkaashoek 2 weeks ago
parent 7ea574948e
commit c2c35978b9

@ -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
}

@ -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;

Loading…
Cancel
Save

Powered by TurnKey Linux.