diff options
| author | Selene ToyKeeper | 2020-09-14 02:32:08 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2020-09-14 02:32:08 -0600 |
| commit | 64fe494434cb8e2afe0882bbd8a83e1d1e4497b4 (patch) | |
| tree | b49444afc47140393ed869a68a82ea44695cf2c1 | |
| parent | added model numbers to each build target, and to version check function (diff) | |
| download | anduril-64fe494434cb8e2afe0882bbd8a83e1d1e4497b4.tar.gz anduril-64fe494434cb8e2afe0882bbd8a83e1d1e4497b4.tar.bz2 anduril-64fe494434cb8e2afe0882bbd8a83e1d1e4497b4.zip | |
fixed bug: ramp 2H at floor went up instead of staying at floor
(thanks to SammysHP for suggesting this fix)
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/anduril/ramp-mode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spaghetti-monster/anduril/ramp-mode.c b/spaghetti-monster/anduril/ramp-mode.c index 93f0d36..90c7368 100644 --- a/spaghetti-monster/anduril/ramp-mode.c +++ b/spaghetti-monster/anduril/ramp-mode.c @@ -142,13 +142,13 @@ uint8_t steady_state(Event event, uint16_t arg) { } // fix ramp direction on first frame if necessary if (!arg) { + // click, hold should always go down if possible + if (event == EV_click2_hold) { ramp_direction = -1; } // make it ramp down instead, if already at max - if (actual_level >= mode_max) { ramp_direction = -1; } + else if (actual_level >= mode_max) { ramp_direction = -1; } // make it ramp up if already at min // (off->hold->stepped_min->release causes this state) else if (actual_level <= mode_min) { ramp_direction = 1; } - // click, hold should always go down if possible - else if (event == EV_click2_hold) { ramp_direction = -1; } } // if the button is stuck, err on the side of safety and ramp down else if ((arg > TICKS_PER_SECOND * 5) && (actual_level >= mode_max)) { |
