diff options
| author | Selene ToyKeeper | 2018-09-01 18:03:21 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2018-09-01 18:03:21 -0600 |
| commit | d51163492931b248636cdb0aab0bb9df3c1c239c (patch) | |
| tree | a162a50700817109120485547c31a39c2e567d28 /spaghetti-monster | |
| parent | Fixed bug introduced in trunk r211.1.9, where Anduril's goodnight mode didn't... (diff) | |
| download | anduril-d51163492931b248636cdb0aab0bb9df3c1c239c.tar.gz anduril-d51163492931b248636cdb0aab0bb9df3c1c239c.tar.bz2 anduril-d51163492931b248636cdb0aab0bb9df3c1c239c.zip | |
Reduced ROM size another 10 bytes by removing redundant call to nearest_level().
Added some comments to clarify what lowest and highest level mean.
Diffstat (limited to 'spaghetti-monster')
| -rw-r--r-- | spaghetti-monster/anduril/anduril.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c index f5c2649..bbf661d 100644 --- a/spaghetti-monster/anduril/anduril.c +++ b/spaghetti-monster/anduril/anduril.c @@ -375,7 +375,7 @@ uint8_t off_state(EventPtr event, uint16_t arg) { return MISCHIEF_MANAGED; } #endif - // hold (initially): go to lowest level, but allow abort for regular click + // hold (initially): go to lowest level (floor), but allow abort for regular click else if (event == EV_click1_press) { set_level(nearest_level(1)); return MISCHIEF_MANAGED; @@ -389,7 +389,7 @@ uint8_t off_state(EventPtr event, uint16_t arg) { } return MISCHIEF_MANAGED; } - // hold, release quickly: go to lowest level + // hold, release quickly: go to lowest level (floor) else if (event == EV_click1_hold_release) { set_state(steady_state, 1); return MISCHIEF_MANAGED; @@ -409,14 +409,14 @@ uint8_t off_state(EventPtr event, uint16_t arg) { set_level(0); return MISCHIEF_MANAGED; } - // click, hold: go to highest level (for ramping down) + // click, hold: go to highest level (ceiling) (for ramping down) else if (event == EV_click2_hold) { set_state(steady_state, MAX_LEVEL); return MISCHIEF_MANAGED; } - // 2 clicks: highest mode + // 2 clicks: highest mode (ceiling) else if (event == EV_2clicks) { - set_state(steady_state, nearest_level(MAX_LEVEL)); + set_state(steady_state, MAX_LEVEL); return MISCHIEF_MANAGED; } #ifdef USE_BATTCHECK |
