aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-ramping.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-10-21 06:51:27 -0600
committerSelene ToyKeeper2017-10-21 06:51:27 -0600
commita154ddbda5477a9b5a66333b8777fd6d1ee99d39 (patch)
tree30f1b2f8869ef78a5dbf3d84fa3ec2e74325a741 /spaghetti-monster/fsm-ramping.c
parentDelay un-setting go_to_standby until the last moment, in case set_level() wan... (diff)
downloadanduril-a154ddbda5477a9b5a66333b8777fd6d1ee99d39.tar.gz
anduril-a154ddbda5477a9b5a66333b8777fd6d1ee99d39.tar.bz2
anduril-a154ddbda5477a9b5a66333b8777fd6d1ee99d39.zip
Moved indicator_led() from Anduril into FSM. Made it auto-set indicator level based on ramp level.
Made Anduril configure voltage fudge and indicator LED functions based on driver type. Removed "ticks_spent_awake" thing since it's redundant. EV_tick arg does the same thing in fewer bytes. Rearranged some clauses in off_state to put events in a more coherent order.
Diffstat (limited to 'spaghetti-monster/fsm-ramping.c')
-rw-r--r--spaghetti-monster/fsm-ramping.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c
index 11e56a5..ec132ae 100644
--- a/spaghetti-monster/fsm-ramping.c
+++ b/spaghetti-monster/fsm-ramping.c
@@ -28,6 +28,13 @@ void set_level(uint8_t level) {
#ifdef USE_SET_LEVEL_GRADUALLY
gradual_target = level;
#endif
+ #ifdef USE_INDICATOR_LED
+ if (! go_to_standby)
+ indicator_led((level > 0) + (level > MAX_1x7135));
+ //if (level > MAX_1x7135) indicator_led(2);
+ //else if (level > 0) indicator_led(1);
+ //else if (! go_to_standby) indicator_led(0);
+ #endif
//TCCR0A = PHASE;
if (level == 0) {
#if PWM_CHANNELS >= 1