aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-07-08 21:55:14 -0600
committerSelene ToyKeeper2020-07-08 21:55:14 -0600
commit8d035a179e348c049d920111553334a490b2b8fd (patch)
tree31d6bd17ec674e58fc9fbbec78c7c6be13e98c5c /spaghetti-monster
parentfixed D4v2.5 button LED behavior (diff)
downloadanduril-8d035a179e348c049d920111553334a490b2b8fd.tar.gz
anduril-8d035a179e348c049d920111553334a490b2b8fd.tar.bz2
anduril-8d035a179e348c049d920111553334a490b2b8fd.zip
made lighted button go low/high based on DEFAULT_LEVEL instead of MAX_1x7135,
because the MAX_1x7135 level is wrong on some lights (like the D4v2.5) ... and generally adjusted anything else necessary to make that work. (including a lower default on D18 and D4Sv2, which were both too high)
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/anduril.c8
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d18.h2
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4sv2.h2
-rw-r--r--spaghetti-monster/fsm-ramping.c4
4 files changed, 9 insertions, 7 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index 01904dc..085f4a3 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -105,6 +105,11 @@
#include incfile(CONFIGFILE)
+// brightness to use when no memory is set
+#ifndef DEFAULT_LEVEL
+#define DEFAULT_LEVEL MAX_1x7135
+#endif
+
// thermal properties, if not defined per-driver
#ifndef MIN_THERM_STEPDOWN
#define MIN_THERM_STEPDOWN MAX_1x7135 // lowest value it'll step down to
@@ -415,9 +420,6 @@ void save_config_wl();
#endif
// brightness control
-#ifndef DEFAULT_LEVEL
-#define DEFAULT_LEVEL MAX_1x7135
-#endif
uint8_t memorized_level = DEFAULT_LEVEL;
#ifdef USE_MANUAL_MEMORY
uint8_t manual_memory = 0;
diff --git a/spaghetti-monster/anduril/cfg-emisar-d18.h b/spaghetti-monster/anduril/cfg-emisar-d18.h
index 155a747..72f0589 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d18.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d18.h
@@ -28,7 +28,7 @@
#define QUARTERSPEED_LEVEL 6
// start at ~2000 lm after battery change, not ~150 lm (at Emisar's request)
-#define DEFAULT_LEVEL MAX_Nx7135
+//#define DEFAULT_LEVEL MAX_Nx7135
// higher floor than default, and stop at highest regulated level
#define RAMP_DISCRETE_FLOOR 25
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4sv2.h b/spaghetti-monster/anduril/cfg-emisar-d4sv2.h
index c578c4a..0f3a217 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4sv2.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4sv2.h
@@ -33,7 +33,7 @@
#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
#define RAMP_DISCRETE_STEPS 7
-#define DEFAULT_LEVEL MAX_Nx7135
+//#define DEFAULT_LEVEL MAX_Nx7135
#define STROBE_BRIGHTNESS MAX_LEVEL
#define MUGGLE_FLOOR RAMP_DISCRETE_FLOOR
diff --git a/spaghetti-monster/fsm-ramping.c b/spaghetti-monster/fsm-ramping.c
index bae601e..c3ad8b4 100644
--- a/spaghetti-monster/fsm-ramping.c
+++ b/spaghetti-monster/fsm-ramping.c
@@ -33,7 +33,7 @@ void set_level(uint8_t level) {
#ifdef USE_INDICATOR_LED_WHILE_RAMPING
#ifdef USE_INDICATOR_LED
if (! go_to_standby)
- indicator_led((level > 0) + (level > MAX_1x7135));
+ indicator_led((level > 0) + (level > DEFAULT_LEVEL));
#endif
//if (level > MAX_1x7135) indicator_led(2);
//else if (level > 0) indicator_led(1);
@@ -47,7 +47,7 @@ void set_level(uint8_t level) {
#ifdef USE_AUX_RGB_LEDS
rgb_led_set(0);
#ifdef USE_BUTTON_LED
- button_led_set((level > 0) + (level > MAX_1x7135));
+ button_led_set((level > 0) + (level > DEFAULT_LEVEL));
#endif
#endif
}
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.