~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/cfg-blf-lantern-t1616.h

  • Committer: Selene ToyKeeper
  • Date: 2023-10-28 13:02:38 UTC
  • mto: (483.1.175 anduril2)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: bzr@toykeeper.net-20231028130238-ksjbjyqenih49cyf
switched blf-lt1-t1616 from plain PWM to PWM+DSM
(and made DSM interrupt definitions a bit cleaner)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
// CM_CH1, CM_CH2, CM_BOTH, CM_BLEND, CM_AUTO
20
20
#define DEFAULT_CHANNEL_MODE  CM_AUTO
21
21
#define DEFAULT_BLINK_CHANNEL  CM_BOTH
 
22
#define USE_CHANNEL_MODE_ARGS
22
23
 
23
24
// how much to increase total brightness at middle tint
24
25
// (0 = 100% brightness, 64 = 200% brightness)
26
27
#define TINT_RAMPING_CORRECTION 10  // production model, 115%
27
28
 
28
29
#define RAMP_SIZE 150
29
 
// level_calc.py 1 150 7135 1 30 800
30
 
#define PWM1_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
31
 
#define MAX_1x7135 65
32
 
#define HALFSPEED_LEVEL 14
33
 
#define QUARTERSPEED_LEVEL 5
34
 
 
35
 
// the default of 26 looks a bit flat, so increase it
36
 
#define CANDLE_AMPLITUDE 40
 
30
// delta-sigma modulated PWM (0b0HHHHHHHHLLLLLLL = 0, 8xHigh, 7xLow bits)
 
31
// (max is (255 << 7), because it's 8-bit PWM plus 7 bits of DSM)
 
32
// level_calc.py 3.333 1 150 7135 32 0.2 600 --pwm 32640
 
33
#define PWM1_LEVELS  32,35,38,41,45,50,55,61,67,74,82,91,100,110,121,133,146,160,175,192,209,227,247,268,291,314,340,366,395,424,456,489,524,560,599,639,681,726,772,820,871,924,979,1036,1096,1158,1222,1289,1359,1431,1506,1584,1664,1747,1834,1923,2015,2111,2209,2311,2416,2524,2636,2751,2870,2992,3118,3247,3380,3518,3659,3803,3952,4105,4262,4423,4589,4759,4933,5111,5294,5482,5674,5871,6073,6279,6491,6707,6928,7155,7386,7623,7865,8113,8365,8624,8888,9157,9432,9713,10000,10292,10591,10895,11206,11523,11846,12175,12511,12853,13202,13557,13919,14287,14663,15045,15434,15830,16233,16644,17061,17486,17919,18358,18805,19260,19723,20193,20671,21156,21650,22152,22662,23180,23706,24241,24784,25335,25895,26464,27041,27627,28222,28826,29439,30060,30691,31332,31981,32640
 
34
 
 
35
#define DEFAULT_LEVEL 75
 
36
#define MAX_1x7135 75
 
37
#define HALFSPEED_LEVEL 1  // lowest level for tint ramping correction
 
38
#define QUARTERSPEED_LEVEL 1
 
39
#undef USE_DYNAMIC_UNDERCLOCKING  // makes huge bumps in the ramp
 
40
 
 
41
#define USE_SET_LEVEL_GRADUALLY
 
42
 
37
43
 
38
44
// override default ramp style
39
45
#undef RAMP_STYLE
42
48
// because this lantern isn't overpowered
43
49
#define RAMP_SMOOTH_FLOOR    1
44
50
#define RAMP_SMOOTH_CEIL     150
45
 
#define RAMP_DISCRETE_FLOOR  10
 
51
#define RAMP_DISCRETE_FLOOR  1
46
52
#define RAMP_DISCRETE_CEIL   150
47
53
#define RAMP_DISCRETE_STEPS  7
48
54
 
58
64
#define USE_SOS_MODE
59
65
#define USE_SOS_MODE_IN_BLINKY_GROUP
60
66
 
 
67
// the default of 26 looks a bit flat, so increase it
 
68
#define CANDLE_AMPLITUDE 40
 
69
 
 
70
#define USE_POLICE_COLOR_STROBE_MODE
 
71
#define POLICE_COLOR_STROBE_CH1        CM_CH1
 
72
#define POLICE_COLOR_STROBE_CH2        CM_CH2
 
73
// aux red + aux blue are the correct colors, but are dim
 
74
//#define POLICE_COLOR_STROBE_CH1        CM_AUXRED
 
75
//#define POLICE_COLOR_STROBE_CH2        CM_AUXBLU
 
76
 
 
77
#undef  TACTICAL_LEVELS
 
78
#define TACTICAL_LEVELS 120,30,(RAMP_SIZE+3)  // high, low, police strobe
 
79
 
 
80
// party strobe, tac strobe, police, lightning, candle, bike
 
81
#define DEFAULT_STROBE_CHANNELS  CM_BOTH,CM_BOTH,CM_BOTH,CM_AUTO,CM_AUTO,CM_AUTO
 
82
 
61
83
// the sensor (attiny1616) is nowhere near the emitters
62
84
// so thermal regulation can't work
63
85
#ifdef USE_THERMAL_REGULATION
76
98
#define BLINK_AT_RAMP_CEIL
77
99
#endif
78
100
 
79
 
#define USE_CHANNEL_MODE_ARGS
80
 
#define USE_SET_LEVEL_GRADUALLY
81
 
 
82
101
// for consistency with other models
83
102
#define USE_SOFT_FACTORY_RESET
84
103