aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-misc.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-05-02 05:19:50 -0600
committerSelene ToyKeeper2023-05-02 05:19:50 -0600
commite8d7e8ea11696bb2cad60c309527d02f130f7687 (patch)
tree5359ec480940ff2c7ed7e38e5cc847086ed3d70f /spaghetti-monster/fsm-misc.c
parentconverted Wurkkos TS10 build (and made its ramp smoother w/ better low modes) (diff)
downloadanduril-e8d7e8ea11696bb2cad60c309527d02f130f7687.tar.gz
anduril-e8d7e8ea11696bb2cad60c309527d02f130f7687.tar.bz2
anduril-e8d7e8ea11696bb2cad60c309527d02f130f7687.zip
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.
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/fsm-misc.c10
1 files changed, 10 insertions, 0 deletions
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