diff options
| author | Selene ToyKeeper | 2018-09-01 17:29:29 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2018-09-01 17:29:29 -0600 |
| commit | 4e23fbbf8b1a155c830a2db79d412687332ce031 (patch) | |
| tree | 98f5861240772f8772bfa6ef3c272301065248d5 | |
| parent | Added support for the BLF/Lumintop GT Mini. (diff) | |
| download | anduril-4e23fbbf8b1a155c830a2db79d412687332ce031.tar.gz anduril-4e23fbbf8b1a155c830a2db79d412687332ce031.tar.bz2 anduril-4e23fbbf8b1a155c830a2db79d412687332ce031.zip | |
Reduced moon-during-lockout code size by 10 bytes.
| -rw-r--r-- | spaghetti-monster/anduril/anduril.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index d4e541d..f5c2649 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -1098,16 +1098,15 @@ uint8_t lockout_state(EventPtr event, uint16_t arg) { last = pgm_read_byte(event + i); if (arg == 0) { // Only turn on/off when button state changes if ((last == A_PRESS) || (last == A_HOLD)) { - // detect moon level and activate it - uint8_t lvl = ramp_smooth_floor; #ifdef LOCKOUT_MOON_LOWEST // Use lowest moon configured + uint8_t lvl = ramp_smooth_floor; if (ramp_discrete_floor < lvl) lvl = ramp_discrete_floor; + set_level(lvl); #else // Use moon from current ramp - if (ramp_style) lvl = ramp_discrete_floor; + set_level(nearest_level(1)); #endif - set_level(lvl); } else if ((last == A_RELEASE) || (last == A_RELEASE_TIMEOUT)) { set_level(0); |
