aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-07-30 03:25:45 -0600
committerSelene ToyKeeper2020-07-30 03:25:45 -0600
commitda2e70747481a89a70eaeda1a494a99a7aaf8c94 (patch)
tree75e64b64da4bbf286a56a7dbf60f12464e4f9797
parentfixed bug where light would shut itself off immediately if sunset timer was a... (diff)
downloadanduril-da2e70747481a89a70eaeda1a494a99a7aaf8c94.tar.gz
anduril-da2e70747481a89a70eaeda1a494a99a7aaf8c94.tar.bz2
anduril-da2e70747481a89a70eaeda1a494a99a7aaf8c94.zip
fixed bug: ramp mode acted strange if ramp level was changed after turning on sunset timer
(it kept trying to adjust based on the original brightness, instead of the new brightness)
-rw-r--r--spaghetti-monster/anduril/ramp-mode.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/spaghetti-monster/anduril/ramp-mode.c b/spaghetti-monster/anduril/ramp-mode.c
index a0a123d..5ca5dbb 100644
--- a/spaghetti-monster/anduril/ramp-mode.c
+++ b/spaghetti-monster/anduril/ramp-mode.c
@@ -21,6 +21,7 @@
#define RAMP_MODE_C
#include "ramp-mode.h"
+
#ifdef USE_SUNSET_TIMER
#include "sunset-timer.h"
#endif
@@ -117,6 +118,9 @@ uint8_t steady_state(Event event, uint16_t arg) {
else {
set_level_and_therm_target(memorized_level);
}
+ #ifdef USE_SUNSET_TIMER
+ timer_orig_level = actual_level;
+ #endif
return MISCHIEF_MANAGED;
}
// hold: change brightness (brighter)
@@ -185,6 +189,9 @@ uint8_t steady_state(Event event, uint16_t arg) {
}
#endif
set_level_and_therm_target(memorized_level);
+ #ifdef USE_SUNSET_TIMER
+ timer_orig_level = actual_level;
+ #endif
return MISCHIEF_MANAGED;
}
#if defined(USE_REVERSING) || defined(START_AT_MEMORIZED_LEVEL)
@@ -242,6 +249,9 @@ uint8_t steady_state(Event event, uint16_t arg) {
}
#endif
set_level_and_therm_target(memorized_level);
+ #ifdef USE_SUNSET_TIMER
+ timer_orig_level = actual_level;
+ #endif
return MISCHIEF_MANAGED;
}
#ifdef START_AT_MEMORIZED_LEVEL
@@ -381,6 +391,9 @@ uint8_t steady_state(Event event, uint16_t arg) {
blip();
memorized_level = nearest_level(actual_level);
set_level_and_therm_target(memorized_level);
+ #ifdef USE_SUNSET_TIMER
+ timer_orig_level = actual_level;
+ #endif
return MISCHIEF_MANAGED;
}
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.