aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-09-15 01:27:18 -0600
committerSelene ToyKeeper2021-09-15 01:27:18 -0600
commit7bb4ee663dca7da96e4c6ce2519f4cd3f5faf494 (patch)
tree24dffd609c1447c73582f26767a2a9f0018a63f4
parentfixed wrong value on D4Sv2-tintramp ramp calculator (was off by one) (diff)
downloadanduril-7bb4ee663dca7da96e4c6ce2519f4cd3f5faf494.tar.gz
anduril-7bb4ee663dca7da96e4c6ce2519f4cd3f5faf494.tar.bz2
anduril-7bb4ee663dca7da96e4c6ce2519f4cd3f5faf494.zip
added Noctigon K9.3-tintramp build targets for FET, reduced FET, and noFET
(apparently Hank liked the D4Sv2-tintramp demo/experiment so much that he decided to use it in production for the K9.3... so it need its own builds since it's a pretty different light even if the driver is almost identical)
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-219.h10
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-fet.h63
-rw-r--r--spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-nofet.h84
3 files changed, 157 insertions, 0 deletions
diff --git a/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-219.h b/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-219.h
new file mode 100644
index 0000000..04efa83
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-219.h
@@ -0,0 +1,10 @@
+// Noctigon K9.3 tint-ramping (reduced FET) config options for Anduril
+#include "cfg-noctigon-k9.3-tintramp-fet.h"
+#undef MODEL_NUMBER
+#define MODEL_NUMBER "0267"
+// ATTINY: 1634
+
+// 85% FET power
+#undef PWM2_LEVELS
+#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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,11,17,24,33,41,51,60,70,80,91,103,116,129,141,156,170,185,200,216
+
diff --git a/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-fet.h b/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-fet.h
new file mode 100644
index 0000000..8535c57
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-fet.h
@@ -0,0 +1,63 @@
+// Noctigon K9.3 tint-ramping (plus FET) config options for Anduril
+#include "cfg-noctigon-k9.3-tintramp-nofet.h"
+#undef MODEL_NUMBER
+#define MODEL_NUMBER "0266"
+// ATTINY: 1634
+
+// enable the FET channel, even though it's ... kinda funky
+#undef PWM_CHANNELS
+#define PWM_CHANNELS 2
+
+// main LEDs
+// output: 3000 lm?
+// FET: 5000 to 7500 lm
+// 2nd LEDs
+// output: 1500 lm?
+#define RAMP_LENGTH 150
+// level_calc.py 5.01 1 130 7135 1 0.2 2000 --pwm dyn:64:16383:511
+// plus a FET segment
+// level_calc.py 2 1 20 7135 5 1000.0 7000 --pwm 255
+// abstract ramp (power is split between both sets of LEDs)
+// ','.join([str(511 - int(x*2.005)) for x in fet])
+#undef PWM1_LEVELS
+// append: ,501,485,469,453,433,413,391,369,345,321,295,267,237,207,177,143,108,74,38,0
+#define PWM1_LEVELS 1,1,1,2,2,3,3,4,5,6,7,8,9,10,12,13,15,16,18,20,22,24,27,29,32,34,37,40,43,46,49,53,56,59,63,66,70,73,77,80,83,87,90,93,96,98,100,103,104,105,106,107,106,105,104,101,98,94,89,83,76,67,57,46,33,35,37,39,41,43,46,48,51,53,56,59,62,65,68,72,75,79,83,86,91,95,99,104,108,113,118,123,129,135,140,146,153,159,166,172,179,187,194,202,210,218,227,236,245,254,264,274,284,295,306,317,328,340,352,365,378,391,405,419,433,448,463,479,495,511,501,485,469,453,433,413,391,369,345,321,295,267,237,207,177,143,108,74,38,0
+#undef PWM_TOPS
+// append: ,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511
+#define PWM_TOPS 16383,13233,9780,13825,9592,13434,9971,12020,12899,13192,13149,12898,12507,12022,12665,11981,12180,11421,11392,11246,11017,10730,10825,10433,10364,9926,9766,9564,9331,9075,8805,8692,8394,8095,7927,7625,7438,7142,6947,6664,6392,6202,5945,5699,5464,5186,4925,4726,4450,4194,3956,3734,3462,3212,2982,2717,2475,2230,1985,1741,1500,1244,996,755,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511
+// prepend: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,13,21,29,39,49,60,71,83,95,108,122,137,152,167,184,201,218,236,255
+#undef DEFAULT_LEVEL
+#define DEFAULT_LEVEL 70
+#undef MAX_1x7135
+#define MAX_1x7135 130
+
+#undef RAMP_SMOOTH_FLOOR
+#define RAMP_SMOOTH_FLOOR 10 // level 1 is unreliable (?)
+#undef RAMP_SMOOTH_CEIL
+#define RAMP_SMOOTH_CEIL 130
+// 10, 30, 50, [70], 90, 110, [130]
+#undef RAMP_DISCRETE_FLOOR
+#define RAMP_DISCRETE_FLOOR 10
+#undef RAMP_DISCRETE_CEIL
+#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
+#undef RAMP_DISCRETE_STEPS
+#define RAMP_DISCRETE_STEPS 7
+
+// safe limit highest regulated power (no FET or turbo)
+#undef SIMPLE_UI_FLOOR
+#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR
+#undef SIMPLE_UI_CEIL
+#define SIMPLE_UI_CEIL RAMP_DISCRETE_CEIL
+#undef SIMPLE_UI_STEPS
+#define SIMPLE_UI_STEPS 5
+
+// stop panicking at ~3000 lm
+#undef THERM_FASTER_LEVEL
+#define THERM_FASTER_LEVEL 130
+#undef MIN_THERM_STEPDOWN
+#define MIN_THERM_STEPDOWN 65 // should be above highest dyn_pwm level
+
+// speed up party strobe; the FET is really fast
+#undef PARTY_STROBE_ONTIME
+
diff --git a/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-nofet.h b/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-nofet.h
new file mode 100644
index 0000000..21ab415
--- /dev/null
+++ b/spaghetti-monster/anduril/cfg-noctigon-k9.3-tintramp-nofet.h
@@ -0,0 +1,84 @@
+// Noctigon K9.3 noFET tint-ramping config options for Anduril
+#define MODEL_NUMBER "0265"
+#include "hwdef-Emisar_D4Sv2-tintramp.h"
+#include "hank-cfg.h"
+// ATTINY: 1634
+
+// this light has three aux LED channels: R, G, B
+#define USE_AUX_RGB_LEDS
+// the aux LEDs are front-facing, so turn them off while main LEDs are on
+// it also has an independent LED in the button
+#define USE_BUTTON_LED
+// TODO: the whole "indicator LED" thing needs to be refactored into
+// "aux LED(s)" and "button LED(s)" since they work a bit differently
+// enabling this option breaks the button LED on D4v2.5
+#ifdef USE_INDICATOR_LED_WHILE_RAMPING
+#undef USE_INDICATOR_LED_WHILE_RAMPING
+#endif
+
+// has two channels of independent LEDs
+#define USE_TINT_RAMPING
+// how much to increase total brightness at middle tint
+// (0 = 100% brightness, 64 = 200% brightness)
+#define TINT_RAMPING_CORRECTION 0 // none, linear regulator doesn't need it
+
+// main LEDs
+// output: 3000 lm?
+// FET: disabled
+// 2nd LEDs
+// output: 1500 lm?
+#define RAMP_LENGTH 150
+// level_calc.py 5.01 1 150 7135 1 0.2 2000 --pwm dyn:74:16383:511
+// abstract ramp (power is split between both sets of LEDs)
+#define PWM1_LEVELS 1,1,1,2,2,2,3,4,4,5,6,6,7,8,9,10,12,13,14,16,17,19,20,22,24,26,28,30,32,35,37,40,42,45,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,91,94,96,98,100,102,104,105,106,107,107,107,106,105,103,101,98,94,90,84,78,71,63,54,44,33,35,37,38,40,42,44,46,48,50,53,55,57,60,63,65,68,71,74,77,80,83,87,90,94,98,102,106,110,114,118,123,128,132,137,142,148,153,159,164,170,176,183,189,196,202,209,216,224,231,239,247,255,263,272,281,290,299,309,318,328,339,349,360,371,382,394,406,418,430,443,456,469,483,497,511
+#define PWM_TOPS 16383,13673,10738,15435,11908,8123,12779,14756,12240,13447,14013,11907,12263,12351,12261,12048,12926,12464,11972,12278,11704,11789,11180,11134,11013,10837,10620,10371,10100,10113,9793,9718,9376,9248,8898,8738,8560,8369,8168,7961,7749,7535,7321,7107,6895,6686,6480,6278,6080,5823,5639,5403,5178,4965,4763,4570,4346,4134,3936,3714,3507,3283,3074,2853,2648,2433,2211,2006,1776,1564,1351,1137,924,714,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511,511
+#define DEFAULT_LEVEL 70
+#define MAX_1x7135 150
+#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 10 // level 1 is unreliable (?)
+#define RAMP_SMOOTH_CEIL 130
+// 10, 30, 50, [70], 90, 110, [130]
+#define RAMP_DISCRETE_FLOOR 10
+#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
+#define RAMP_DISCRETE_STEPS 7
+
+// safe limit highest regulated power (no FET or turbo)
+#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR
+#define SIMPLE_UI_CEIL RAMP_DISCRETE_CEIL
+#define SIMPLE_UI_STEPS 5
+
+// stop panicking at ~2000 lm
+#define THERM_FASTER_LEVEL 140
+#define MIN_THERM_STEPDOWN 75 // should be above highest dyn_pwm level
+
+// use the brightest setting for strobe
+#define STROBE_BRIGHTNESS MAX_LEVEL
+// slow down party strobe; this driver can't pulse for 1ms or less
+#define PARTY_STROBE_ONTIME 2
+
+// the default of 26 looks a bit flat, so increase it
+#define CANDLE_AMPLITUDE 40
+
+// the power regulator is a bit slow, so push it harder for a quick response from off
+#define DEFAULT_JUMP_START_LEVEL 21
+#define BLINK_BRIGHTNESS DEFAULT_LEVEL
+#define BLINK_ONCE_TIME 12 // longer blink, since main LEDs are slow
+
+#define THERM_CAL_OFFSET 9
+
+#ifdef BLINK_AT_RAMP_MIDDLE
+#undef BLINK_AT_RAMP_MIDDLE
+#endif
+
+// for consistency with KR4 (not otherwise necessary though)
+#define USE_SOFT_FACTORY_RESET
+
+
+// work around bizarre bug: lockout mode fails when set to solid color blinking
+#define USE_K93_LOCKOUT_KLUDGE