aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/fsm-misc.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-misc.c b/spaghetti-monster/fsm-misc.c
index 1c40b81..dacca85 100644
--- a/spaghetti-monster/fsm-misc.c
+++ b/spaghetti-monster/fsm-misc.c
@@ -33,15 +33,29 @@ uint8_t blink_digit(uint8_t num) {
if (!num) { ontime = 8; num ++; }
#ifdef BLINK_CHANNEL
+ // channel is set per blink, to prevent issues
+ // if another mode interrupts us (like a config menu)
uint8_t old_channel = CH_MODE;
- set_channel_mode(BLINK_CHANNEL);
#endif
for (; num>0; num--) {
// TODO: allow setting a blink channel mode per build target
+ #ifdef BLINK_CHANNEL
+ set_channel_mode(BLINK_CHANNEL);
+ #endif
set_level(BLINK_BRIGHTNESS);
+ #ifdef BLINK_CHANNEL
+ CH_MODE = old_channel;
+ #endif
nice_delay_ms(ontime);
+
+ #ifdef BLINK_CHANNEL
+ set_channel_mode(BLINK_CHANNEL);
+ #endif
set_level(0);
+ #ifdef BLINK_CHANNEL
+ CH_MODE = old_channel;
+ #endif
nice_delay_ms(BLINK_SPEED * 3 / 12);
}
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.