From e8d7e8ea11696bb2cad60c309527d02f130f7687 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Tue, 2 May 2023 05:19:50 -0600 Subject: added ability to set channel mode for number readouts (batt check, temp check, version check) Press 3C in batt check mode to change the blink channel. Also fixed TS10 stepped ramp ceiling value. --- spaghetti-monster/fsm-misc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spaghetti-monster/fsm-misc.c') diff --git a/spaghetti-monster/fsm-misc.c b/spaghetti-monster/fsm-misc.c index 80652b3..1c40b81 100644 --- a/spaghetti-monster/fsm-misc.c +++ b/spaghetti-monster/fsm-misc.c @@ -32,6 +32,11 @@ uint8_t blink_digit(uint8_t num) { uint8_t ontime = BLINK_SPEED * 2 / 12; if (!num) { ontime = 8; num ++; } + #ifdef BLINK_CHANNEL + 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 set_level(BLINK_BRIGHTNESS); @@ -39,6 +44,11 @@ uint8_t blink_digit(uint8_t num) { set_level(0); nice_delay_ms(BLINK_SPEED * 3 / 12); } + + #ifdef BLINK_CHANNEL + set_channel_mode(old_channel); + #endif + return nice_delay_ms(BLINK_SPEED * 8 / 12); } #endif -- cgit v1.2.3