aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-misc.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-08-22 23:28:35 -0600
committerSelene ToyKeeper2018-08-22 23:28:35 -0600
commit0499082b50b00d942e00d2d272a0c74b4c5ca1cd (patch)
tree95d10d2cdce1b62c2288bb28064bf519b0dfabf3 /spaghetti-monster/fsm-misc.c
parentRearranged strobe group mode order, fixed party strobe. (diff)
downloadanduril-0499082b50b00d942e00d2d272a0c74b4c5ca1cd.tar.gz
anduril-0499082b50b00d942e00d2d272a0c74b4c5ca1cd.tar.bz2
anduril-0499082b50b00d942e00d2d272a0c74b4c5ca1cd.zip
Reduced ROM size by making successive nice_delay_ms calls collapse any time the user completes an input sequence.
All nice delays then get aborted until the next trip through the main() loop. Eliminates the need to wrap nice_delay_ms() calls and handle the exit condition. Also eliminates the risk of getting the UI out of sync with button events.
Diffstat (limited to 'spaghetti-monster/fsm-misc.c')
-rw-r--r--spaghetti-monster/fsm-misc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/spaghetti-monster/fsm-misc.c b/spaghetti-monster/fsm-misc.c
index acef28c..e60909e 100644
--- a/spaghetti-monster/fsm-misc.c
+++ b/spaghetti-monster/fsm-misc.c
@@ -49,11 +49,9 @@ uint8_t blink_digit(uint8_t num) {
for (; num>0; num--) {
set_level(BLINK_BRIGHTNESS);
- if (! nice_delay_ms(ontime)) { return 0; }
+ nice_delay_ms(ontime);
set_level(0);
- //if (current_state != old_state) return 0;
- if (! nice_delay_ms(400)) return 0;
- //if (current_state != old_state) return 0;
+ nice_delay_ms(400);
}
return nice_delay_ms(600);
}
@@ -77,7 +75,7 @@ uint8_t blink_num(uint8_t num) {
#if 0
// wait a moment in the dark before starting
set_level(0);
- if (! nice_delay_ms(200)) return 0;
+ nice_delay_ms(200);
#endif
#if 0
@@ -102,7 +100,7 @@ uint8_t blink_num(uint8_t num) {
volts = voltage / 10;
tenths = voltage % 10;
if (! blink(volts)) return;
- if (! nice_delay_ms(200)) return;
+ nice_delay_ms(200);
if (! blink(tenths)) return;
nice_delay_ms(200);
*/