aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/anduril/cfg-emisar-d4v2.h60
-rw-r--r--spaghetti-monster/chan-rgbaux.c19
-rw-r--r--spaghetti-monster/chan-rgbaux.h11
3 files changed, 72 insertions, 18 deletions
diff --git a/spaghetti-monster/anduril/cfg-emisar-d4v2.h b/spaghetti-monster/anduril/cfg-emisar-d4v2.h
index 670482c..5ebf5e0 100644
--- a/spaghetti-monster/anduril/cfg-emisar-d4v2.h
+++ b/spaghetti-monster/anduril/cfg-emisar-d4v2.h
@@ -4,34 +4,58 @@
#pragma once
#define MODEL_NUMBER "0113"
-#include "hwdef-Emisar_D4v2.h"
+#include "hwdef-emisar-d4v2.h"
#include "hank-cfg.h"
// ATTINY: 1634
-// copied from original D4, since it's also a FET+1 and has the same host
-// ../../bin/level_calc.py 1 65 7135 1 0.8 150
-// ... mixed with this:
-// ../../bin/level_calc.py 2 150 7135 4 0.33 150 FET 1 10 1500
#define RAMP_SIZE 150
-#define LOW_PWM_LEVELS 1,1,2,2,3,3,4,4,5,6,7,8,9,10,12,13,14,15,17,19,20,22,24,26,29,31,34,36,39,42,45,48,51,55,59,62,66,70,75,79,84,89,93,99,104,110,115,121,127,134,140,147,154,161,168,176,184,192,200,209,217,226,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
-#define HIGH_PWM_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,1,3,4,5,7,8,9,11,12,14,15,17,19,20,22,24,25,27,29,31,33,35,37,39,41,43,45,48,50,52,55,57,59,62,64,67,70,72,75,78,81,84,87,90,93,96,99,102,105,109,112,115,119,122,126,129,133,137,141,144,148,152,156,160,165,169,173,177,182,186,191,195,200,205,209,214,219,224,229,234,239,244,250,255
-#define MAX_1x7135 65
-#define HALFSPEED_LEVEL 14
-#define QUARTERSPEED_LEVEL 6
+
+// 7135 at 65/150
+//// level_calc.py 4.2905 2 150 7135 1 0.1 130 FET 1 10 3000 --pwm dyn:64:4096:255:3
+//#define PWM1_LEVELS 1,1,3,4,5,7,8,10,12,14,17,19,21,24,27,30,32,35,38,41,44,48,51,54,57,60,63,65,68,71,73,76,79,81,83,85,88,90,92,94,96,99,101,103,106,109,112,115,119,123,127,132,138,144,150,157,165,173,182,193,204,216,228,241,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,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,1,1,2,3,4,4,5,6,7,8,9,10,11,12,13,14,15,16,18,19,20,22,23,25,26,28,29,31,33,35,36,38,40,42,44,47,49,51,53,56,58,61,63,66,69,72,74,77,80,84,87,90,93,97,100,104,108,112,115,119,124,128,132,136,141,146,150,155,160,165,170,175,181,186,192,198,203,209,216,222,228,235,241,248,255
+//#define PWM_TOPS 4095,2008,3646,3292,2938,3156,2761,2752,2665,2539,2555,2382,2214,2150,2067,1975,1820,1731,1641,1553,1468,1417,1336,1260,1188,1120,1057,982,928,877,818,775,734,687,644,605,575,541,509,480,453,432,409,387,370,354,339,324,313,303,292,285,279,273,267,263,260,258,256,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+
+// 7135 at 75/150
+// level_calc.py 5.7895 2 150 7135 1 0.1 130 FET 1 10 3000 --pwm dyn:74:4096:255:3
+// (with some manual tweaks)
+#define PWM1_LEVELS 1,1,2,3,3,4,5,6,7,8,9,11,12,13,15,16,18,19,21,23,26,27,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,71,74,76,78,80,82,85,87,90,93,96,100,103,107,112,116,122,127,133,140,147,154,163,171,182,192,203,215,228,241,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,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,1,1,2,3,4,5,5,6,7,8,9,10,11,13,14,15,16,18,19,20,22,24,25,27,29,30,32,34,36,39,41,43,45,48,50,53,56,58,61,64,67,71,74,77,81,84,88,92,96,100,104,109,113,118,123,128,133,138,144,149,155,161,167,173,180,186,193,200,207,215,222,230,238,247,255
+#define PWM_TOPS 4095,2701,3200,3586,2518,2778,2834,2795,2705,2587,2455,2582,2412,2247,2256,2091,2062,1907,1860,1802,1737,1605,1542,1477,1412,1347,1284,1222,1162,1105,1050,997,946,898,853,810,768,730,693,658,625,594,564,536,503,485,462,439,418,398,384,366,353,340,327,319,307,298,292,284,280,273,269,266,263,260,258,256,256,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+
+//#define LOW_PWM_LEVELS 1,1,2,2,3,3,4,4,5,6,7,8,9,10,12,13,14,15,17,19,20,22,24,26,29,31,34,36,39,42,45,48,51,55,59,62,66,70,75,79,84,89,93,99,104,110,115,121,127,134,140,147,154,161,168,176,184,192,200,209,217,226,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,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
+//#define HIGH_PWM_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,1,3,4,5,7,8,9,11,12,14,15,17,19,20,22,24,25,27,29,31,33,35,37,39,41,43,45,48,50,52,55,57,59,62,64,67,70,72,75,78,81,84,87,90,93,96,99,102,105,109,112,115,119,122,126,129,133,137,141,144,148,152,156,160,165,169,173,177,182,186,191,195,200,205,209,214,219,224,229,234,239,244,250,255
+#define MAX_1x7135 75
+#define MIN_THERM_STEPDOWN 70 // should be above highest dyn_pwm level
+#define HALFSPEED_LEVEL 20
+#define QUARTERSPEED_LEVEL 5
#define RAMP_SMOOTH_FLOOR 1
-#define RAMP_SMOOTH_CEIL 120
-// 10, 28, 46, [65], 83, 101, 120
-#define RAMP_DISCRETE_FLOOR 10
+#define RAMP_SMOOTH_CEIL 130
+// 20, 38, 56, [75], 93, 111, 130
+#define RAMP_DISCRETE_FLOOR 20
#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
#define RAMP_DISCRETE_STEPS 7
-// safe limit ~20% power
-#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR
-#define SIMPLE_UI_CEIL 95
+// 20, 40, 60, 80, 100
+#define SIMPLE_UI_FLOOR 20
+#define SIMPLE_UI_CEIL 100
#define SIMPLE_UI_STEPS 5
-// stop panicking at ~30% power or ~1200 lm
-#define THERM_FASTER_LEVEL 105
+// stop panicking at ~25% power or ~1000 lm
+#define THERM_FASTER_LEVEL 110
#define THERM_CAL_OFFSET 5
+
+// use aux red + aux blue for police strobe
+#define USE_POLICE_COLOR_STROBE_MODE
+#define POLICE_STROBE_USES_AUX
+#define POLICE_COLOR_STROBE_CH1 CM_AUXRED
+#define POLICE_COLOR_STROBE_CH2 CM_AUXBLU
+
+// the default of 26 looks a bit rough, so increase it to make it smoother
+#define CANDLE_AMPLITUDE 33
+
+// show each channel while it scroll by in the menu
+#define USE_CONFIG_COLORS
+
diff --git a/spaghetti-monster/chan-rgbaux.c b/spaghetti-monster/chan-rgbaux.c
new file mode 100644
index 0000000..355f246
--- /dev/null
+++ b/spaghetti-monster/chan-rgbaux.c
@@ -0,0 +1,19 @@
+// channel modes for RGB aux LEDs
+// Copyright (C) 2023 Selene ToyKeeper
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+void set_level_auxred(uint8_t level) {
+ rgb_led_set(!(!(level)) << 1); // red, high (or off)
+}
+
+void set_level_auxgrn(uint8_t level) {
+ rgb_led_set(!(!(level)) << 3); // green, high (or off)
+}
+
+void set_level_auxblu(uint8_t level) {
+ rgb_led_set(!(!(level)) << 5); // blue, high (or off)
+}
+
+bool gradual_tick_null(uint8_t gt) { return true; } // do nothing
+
diff --git a/spaghetti-monster/chan-rgbaux.h b/spaghetti-monster/chan-rgbaux.h
new file mode 100644
index 0000000..5c1c5c3
--- /dev/null
+++ b/spaghetti-monster/chan-rgbaux.h
@@ -0,0 +1,11 @@
+// channel modes for RGB aux LEDs
+// Copyright (C) 2023 Selene ToyKeeper
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+void set_level_auxred(uint8_t level);
+void set_level_auxgrn(uint8_t level);
+void set_level_auxblu(uint8_t level);
+
+bool gradual_tick_null(uint8_t gt);
+
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.