aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-10-22 02:56:00 -0600
committerSelene ToyKeeper2020-10-22 02:56:00 -0600
commitfa6155c367f14ebe229ce8c6248429a45b3605d2 (patch)
treea3db8cd93a5257d8f61efb423c75a78a98903d9e
parentnope, the pins weren't swapped... the wires on the prototype were reversed (diff)
downloadanduril-fa6155c367f14ebe229ce8c6248429a45b3605d2.tar.gz
anduril-fa6155c367f14ebe229ce8c6248429a45b3605d2.tar.bz2
anduril-fa6155c367f14ebe229ce8c6248429a45b3605d2.zip
enabled memory timer and resetting tint after timeout on K9.3
(unsure if I'll keep it this way though, or if the old way was better)
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-k9.3.h4
-rw-r--r--spaghetti-monster/anduril/off-mode.c3
-rw-r--r--spaghetti-monster/anduril/ramp-mode.h10
3 files changed, 15 insertions, 2 deletions
diff --git a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h
index 76ddb05..fd162fe 100644
--- a/spaghetti-monster/anduril/cfg-noctigon-k9.3.h
+++ b/spaghetti-monster/anduril/cfg-noctigon-k9.3.h
@@ -49,6 +49,10 @@ inline void set_level_override(uint8_t level);
#define HALFSPEED_LEVEL 10
#define QUARTERSPEED_LEVEL 2
+#define USE_MANUAL_MEMORY_TIMER_FOR_TINT
+#define DEFAULT_MANUAL_MEMORY DEFAULT_LEVEL
+#define DEFAULT_MANUAL_MEMORY_TIMER 10
+
#define RAMP_SMOOTH_FLOOR 3 // level 1 is unreliable (?)
#define RAMP_SMOOTH_CEIL 120
// 10, 28, [46], 65, 83, 101, [120]
diff --git a/spaghetti-monster/anduril/off-mode.c b/spaghetti-monster/anduril/off-mode.c
index 5ebaa1d..34d9e6d 100644
--- a/spaghetti-monster/anduril/off-mode.c
+++ b/spaghetti-monster/anduril/off-mode.c
@@ -133,6 +133,9 @@ uint8_t off_state(Event event, uint16_t arg) {
&& (off_time >= (manual_memory_timer * SLEEP_TICKS_PER_MINUTE))
#endif
) {
+ #if defined(USE_MANUAL_MEMORY_TIMER_FOR_TINT) && defined(USE_TINT_RAMPING) && defined(TINT_RAMP_TOGGLE_ONLY)
+ tint = 0;
+ #endif
set_level(nearest_level(manual_memory));
} else
#endif
diff --git a/spaghetti-monster/anduril/ramp-mode.h b/spaghetti-monster/anduril/ramp-mode.h
index b772407..ed806bd 100644
--- a/spaghetti-monster/anduril/ramp-mode.h
+++ b/spaghetti-monster/anduril/ramp-mode.h
@@ -148,9 +148,15 @@ void set_level_and_therm_target(uint8_t level);
// brightness control
uint8_t memorized_level = DEFAULT_LEVEL;
#ifdef USE_MANUAL_MEMORY
-uint8_t manual_memory = 0;
+#ifndef DEFAULT_MANUAL_MEMORY
+#define DEFAULT_MANUAL_MEMORY 0
+#endif
+uint8_t manual_memory = DEFAULT_MANUAL_MEMORY;
#ifdef USE_MANUAL_MEMORY_TIMER
-uint8_t manual_memory_timer = 0;
+#ifndef DEFAULT_MANUAL_MEMORY_TIMER
+#define DEFAULT_MANUAL_MEMORY_TIMER 0
+#endif
+uint8_t manual_memory_timer = DEFAULT_MANUAL_MEMORY_TIMER;
#endif
#endif
#ifdef USE_SIMPLE_UI
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.