aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/anduril/anduril.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 5032dcd..e8524a8 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -792,6 +792,10 @@ uint8_t steady_state(Event event, uint16_t arg) {
// (off->hold->stepped_min->release causes this state)
else if (actual_level <= mode_min) { 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)) {
+ ramp_direction = -1;
+ }
memorized_level = nearest_level((int16_t)actual_level \
+ (ramp_step_size * ramp_direction));
#else
@@ -2286,7 +2290,9 @@ void rgb_led_update(uint8_t mode, uint8_t arg) {
actual_color = colors[color];
}
else if (color == 7) { // rainbow
- if (0 == (arg & 0x03)) {
+ uint8_t speed = 0x03; // awake speed
+ if (go_to_standby) speed = 0x0f; // asleep speed
+ if (0 == (arg & speed)) {
rainbow = (rainbow + 1) % 6;
}
actual_color = colors[rainbow];
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.