aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--spaghetti-monster/anduril/cfg-sofirn-lt1s-pro.h39
-rw-r--r--spaghetti-monster/anduril/channel-modes.h1
-rw-r--r--spaghetti-monster/fsm-ramping.h2
3 files changed, 22 insertions, 20 deletions
diff --git a/spaghetti-monster/anduril/cfg-sofirn-lt1s-pro.h b/spaghetti-monster/anduril/cfg-sofirn-lt1s-pro.h
index e009e02..c9e786d 100644
--- a/spaghetti-monster/anduril/cfg-sofirn-lt1s-pro.h
+++ b/spaghetti-monster/anduril/cfg-sofirn-lt1s-pro.h
@@ -4,31 +4,32 @@
#include "hwdef-Sofirn_LT1S-Pro.h"
// ATTINY: 1616
-// off mode: high (1)
+// off mode: high (2)
// lockout: blinking (3)
-#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1)
+#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 2)
-// the lantern has two PWM channels, but they drive different sets of emitters
-// (one channel for warm emitters, one channel for cold)
-// so enable a special ramping mode which changes tint instead of brightness
-//#define USE_TINT_RAMPING
// how much to increase total brightness at middle tint
// (0 = 100% brightness, 64 = 200% brightness)
-#define TINT_RAMPING_CORRECTION 10 // 115%
+// seems unnecessary on this light
+#define TINT_RAMPING_CORRECTION 0
-// level_calc.py 1 150 7135 1 30 800
#define RAMP_SIZE 150
-// TODO: use dynamic PWM instead of plain 8-bit
+// TODO? 200% power at top of ramp on white blend mode
+// use dynamic PWM instead of plain 8-bit
// (so we can get lower lows and a smoother ramp)
-// TODO: 200% power at top of ramp on white blend mode
-#define PWM_LEVELS 1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11,11,12,13,13,14,15,15,16,17,18,18,19,20,21,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,48,49,50,51,53,54,56,57,58,60,61,63,64,66,67,69,70,72,74,75,77,79,80,82,84,85,87,89,91,93,95,97,98,100,102,104,106,108,111,113,115,117,119,121,124,126,128,130,133,135,137,140,142,145,147,150,152,155,157,160,163,165,168,171,173,176,179,182,185,188,190,193,196,199,202,205,209,212,215,218,221,224,228,231,234,238,241,245,248,251,255
-#define BLEND_PWM_LEVELS PWM_LEVELS
-#define RED_PWM_LEVELS PWM_LEVELS
-#define MAX_1x7135 65
+// level_calc.py 5.99 1 150 7135 1 0.2 600 --pwm dyn:74:16383:511
+// (with a few manual tweaks at the mid-point)
+#define PWM_LEVELS 1,1,2,3,3,4,5,6,7,8,9,10,11,13,14,16,17,19,20,22,24,26,28,30,32,34,36,38,41,43,46,48,51,54,56,59,62,65,67,70,73,76,79,82,84,87,90,92,95,97,99,101,103,105,106,107,108,108,109,108,108,107,105,103,101,97,93,89,83,77,70,62,53,43,36,37,38,39,40,42,44,46,48,50,52,54,56,58,60,63,65,68,71,74,77,80,83,87,90,94,98,101,105,109,114,118,123,127,132,137,142,147,153,158,164,170,176,183,189,196,203,210,217,224,232,240,248,257,265,274,283,293,302,312,322,333,343,354,366,377,389,401,414,427,440,453,467,481,496,511
+#define PWM_TOPS 16383,11015,13411,15497,11274,12834,13512,13749,13735,13565,13292,12948,12555,13284,12747,13087,12495,12621,12010,12007,11928,11790,11609,11395,11155,10895,10622,10338,10307,9996,9905,9581,9452,9302,8973,8806,8627,8440,8124,7935,7743,7549,7354,7159,6883,6696,6511,6260,6084,5851,5628,5414,5210,5014,4782,4562,4355,4120,3937,3694,3501,3288,3060,2848,2651,2418,2202,2003,1775,1566,1353,1140,926,713,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
+// shared table for white and red
+#define PWM1_LEVELS PWM_LEVELS
+#define MAX_1x7135 75
// FIXME: clock at 5 MHz w/ full+half+quarter speeds,
// instead of 10 MHz with w/ only half+quarter
// (10 MHz is just wasting power)
-#define HALFSPEED_LEVEL 256 // red LEDs use a QX7138 chip which has max PWM speed of 10 kHz, so never run faster than halfspeed
+// red LEDs use a QX7138 chip which has max PWM speed of 10 kHz,
+// so PWM is 512 clock cycles long to avoid running faster than that
+#define HALFSPEED_LEVEL 12
#define QUARTERSPEED_LEVEL 5
// the default of 26 looks a bit flat, so increase it
@@ -41,16 +42,18 @@
// because this lantern isn't overpowered
#define RAMP_SMOOTH_FLOOR 1
#define RAMP_SMOOTH_CEIL 150
-#define RAMP_DISCRETE_FLOOR 10
+//#define RAMP_DISCRETE_FLOOR 17 // 17 50 83 116 150
+#define RAMP_DISCRETE_FLOOR 1 // 1 25 50 75 100 125 150
#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
-#define RAMP_DISCRETE_STEPS 5
+#define RAMP_DISCRETE_STEPS 7
// LT1S can handle heat well, so don't limit simple mode
+//#define SIMPLE_UI_FLOOR 10 // 10 45 80 115 150
#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR
#define SIMPLE_UI_CEIL RAMP_DISCRETE_CEIL
#define SIMPLE_UI_STEPS RAMP_DISCRETE_STEPS
-// Allow 3C in Simple UI for switching between smooth and stepped ramping
+// Allow 3C (or 6C) in Simple UI (toggle smooth or stepped ramping)
#define USE_SIMPLE_UI_RAMPING_TOGGLE
// allow Aux Config and Strobe Modes in Simple UI
diff --git a/spaghetti-monster/anduril/channel-modes.h b/spaghetti-monster/anduril/channel-modes.h
index f536d58..167c293 100644
--- a/spaghetti-monster/anduril/channel-modes.h
+++ b/spaghetti-monster/anduril/channel-modes.h
@@ -7,7 +7,6 @@
#pragma once
#if defined(USE_MANUAL_MEMORY) && defined(USE_CHANNEL_MODE_ARGS)
-// TODO: save to eeprom
// remember and reset 1 extra parameter per channel mode (like tint)
uint8_t manual_memory_channel_args[NUM_CHANNEL_MODES] = { CHANNEL_MODE_ARGS };
#endif
diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h
index 3021ff2..028157f 100644
--- a/spaghetti-monster/fsm-ramping.h
+++ b/spaghetti-monster/fsm-ramping.h
@@ -168,7 +168,7 @@ PROGMEM const PWM_DATATYPE blend_pwm_levels[] = { BLEND_PWM_LEVELS };
// pulse frequency modulation, a.k.a. dynamic PWM
// (different ceiling / frequency at each ramp level)
// FIXME: dynamic PWM should be a per-channel option, not global
-#ifdef USE_DYN_PWM
+#ifdef PWM_TOPS
PROGMEM const PWM_DATATYPE pwm_tops[] = { PWM_TOPS };
#endif