improved abortion containment.

This commit is contained in:
jpunkt 2022-01-20 16:49:26 +01:00
parent b4dd3e4cb1
commit 43eeb417e9

View file

@ -456,7 +456,6 @@ void serial_do_it() {
lights[i].show(); lights[i].show();
} }
serial_aborted = false; serial_aborted = false;
serial_received();
return; return;
} }
@ -484,8 +483,9 @@ void serial_record() {
blink_status = true; blink_status = true;
int led[] = { BTN_LED_RED }; int led[] = { BTN_LED_RED };
while (time < timeout) { while (!serial_aborted && (time < timeout)) {
btn_red.update(); btn_red.update();
ssp.loop();
if (btn_red.isPressed()) if (btn_red.isPressed())
break; break;
@ -497,6 +497,11 @@ void serial_record() {
} }
digitalWrite(BTN_LED_RED, LOW); digitalWrite(BTN_LED_RED, LOW);
if (serial_aborted) {
serial_aborted = false;
return;
}
serial_received(); serial_received();
} }
@ -570,6 +575,11 @@ void serial_userinteract() {
} }
blink_status = false; blink_status = false;
if (serial_aborted) {
serial_aborted = false;
return;
}
serial_received(btn_pressed); serial_received(btn_pressed);
} }