From a154ddbda5477a9b5a66333b8777fd6d1ee99d39 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sat, 21 Oct 2017 06:51:27 -0600 Subject: 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. --- spaghetti-monster/fsm-ramping.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spaghetti-monster/fsm-ramping.c') 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 -- cgit v1.2.3