improved abortion containment.
This commit is contained in:
parent
b4dd3e4cb1
commit
43eeb417e9
1 changed files with 12 additions and 2 deletions
14
src/main.cpp
14
src/main.cpp
|
@ -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;
|
||||||
|
@ -496,6 +496,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();
|
||||||
}
|
}
|
||||||
|
@ -569,6 +574,11 @@ void serial_userinteract() {
|
||||||
digitalWrite(led, LOW);
|
digitalWrite(led, LOW);
|
||||||
}
|
}
|
||||||
blink_status = false;
|
blink_status = false;
|
||||||
|
|
||||||
|
if (serial_aborted) {
|
||||||
|
serial_aborted = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
serial_received(btn_pressed);
|
serial_received(btn_pressed);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue