aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-07-14 20:07:53 -0600
committerSelene ToyKeeper2018-07-14 20:07:53 -0600
commitcd78d561e114f932abe330dbddda179de6941bc9 (patch)
tree02688c083f6c8c41de3753d829ae9e9fbc012a7f /spaghetti-monster
parentMoved "next aux LED mode" to 7 clicks instead of 14 clicks. (diff)
downloadanduril-cd78d561e114f932abe330dbddda179de6941bc9.tar.gz
anduril-cd78d561e114f932abe330dbddda179de6941bc9.tar.bz2
anduril-cd78d561e114f932abe330dbddda179de6941bc9.zip
Added special 219c build. Fixed bug with forgetting memorized brightness after changing aux LED mode.
(it was actually rebooting after the aux LED change, because it got into an infinite loop of changing state in its leave_state event, which caused a stack overflow... ... so don't change state in a catch-all "else" event handling clause, oops)
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4s-219c.h8
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4s.h1
-rw-r--r--spaghetti-monster/anduril/rampingiosv3.c7
3 files changed, 15 insertions, 1 deletions
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h b/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h
new file mode 100644
index 0000000..8099498
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-emisar-d4s-219c.h
@@ -0,0 +1,8 @@
+// Emisar D4S-219c config options for Anduril
+// same as D4S but with FET modes limited to 80% power
+// to avoid destroying the LEDs
+#include "cfg-emisar-d4s.h"
+
+#undef PWM2_LEVELS
+#define PWM2_LEVELS PWM2_LEVELS_219c
+
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4s.h b/spaghetti-monster/anduril/cfg-emisar-d4s.h
index 568ff67..ddb56ee 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4s.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4s.h
@@ -30,6 +30,7 @@
// (because it made the ramp look better than accurate values)
#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,5,6,6,7,8,8,9,10,10,11,12,13,14,15,16,17,18,19,21,22,23,25,26,27,29,31,32,34,36,38,40,42,44,46,49,51,54,56,59,62,65,68,71,74,78,81,85,89,93,97,101,106,110,115,120,125,130,136,141,147,153,160,166,173,180,187,195,202,210,219,227,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,4,5,7,8,10,11,13,14,16,18,19,21,23,25,27,29,31,34,36,38,41,43,46,48,51,54,57,60,63,66,69,72,76,79,83,87,91,95,99,103,107,112,116,121,126,131,136,141,146,152,158,163,169,175,182,188,195,202,209,216,223,231,239,247,255
+#define PWM2_LEVELS_219c 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,4,5,6,8,8,10,11,12,14,15,16,18,20,21,23,24,27,28,30,32,34,36,38,40,43,45,48,50,52,55,57,60,63,66,69,72,76,79,82,85,89,92,96,100,104,108,112,116,121,126,130,135,140,145,150,156,161,167,172,178,184,191,197,204
#define MAX_1x7135 83
#define HALFSPEED_LEVEL 13
#define QUARTERSPEED_LEVEL 6
diff --git a/spaghetti-monster/anduril/rampingiosv3.c b/spaghetti-monster/anduril/rampingiosv3.c
index d15d8ed..e593a84 100644
--- a/spaghetti-monster/anduril/rampingiosv3.c
+++ b/spaghetti-monster/anduril/rampingiosv3.c
@@ -21,6 +21,7 @@
// Physical driver type (uncomment one of the following or define it at the gcc command line)
//#define FSM_EMISAR_D4_DRIVER
#define FSM_EMISAR_D4S_DRIVER
+//#define FSM_EMISAR_D4S_219c_DRIVER
//#define FSM_BLF_Q8_DRIVER
//#define FSM_FW3A_DRIVER
//#define FSM_BLF_GT_DRIVER
@@ -64,6 +65,9 @@
#elif defined(FSM_EMISAR_D4_DRIVER)
#include "cfg-emisar-d4.h"
+#elif defined(FSM_EMISAR_D4S_219c_DRIVER)
+#include "cfg-emisar-d4s-219c.h"
+
#elif defined(FSM_EMISAR_D4S_DRIVER)
#include "cfg-emisar-d4s.h"
@@ -301,6 +305,7 @@ uint8_t off_state(EventPtr event, uint16_t arg) {
#ifdef USE_INDICATOR_LED
// 7 clicks: next aux LED mode
else if (event == EV_7clicks) {
+ blink_confirm(1);
set_state(auxled_next_state, 0);
return MISCHIEF_MANAGED;
}
@@ -747,7 +752,7 @@ uint8_t auxled_next_state(EventPtr event, uint16_t arg) {
save_config();
return MISCHIEF_MANAGED;
}
- else {
+ else if (event == EV_tick) {
set_state(off_state, 0);
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.