~toykeeper/flashlight-firmware/fsm

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/cfg-sofirn-sp10-pro.h

Merge from TK's main A2 branch thru Rev 647 which includes several patches for the Sofirn SP10 Pro after TK merge that branch in

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
#define USE_DYNAMIC_UNDERCLOCKING
9
9
 
10
 
// PWM generated by: level_calc_dyn.py ninth 1 147 7135 1 1 800 --pwm dyn:64:1024:255
11
 
// and then three steps manually added to the front for the low channel (low channel PWM created manually)
 
10
// 1....15: level_calc.py 3.01 1  15 7135 1 0.1   2 --pwm dyn:15:64:64
 
11
// 16..150: level_calc.py 5.01 1 135 7135 1   2 800 --pwm dyn:49:3072:255:3.0
12
12
#define RAMP_LENGTH 150
13
13
#define USE_DYN_PWM
14
 
#define PWM1_LEVELS 2,12,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
15
 
#define PWM2_LEVELS 0,0,0,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,11,11,11,12,12,13,13,14,15,15,16,16,17,18,19,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,36,37,39,40,42,44,45,47,49,51,53,55,57,59,61,64,66,69,71,74,77,79,82,85,89,92,95,99,102,106,110,114,118,122,126,131,135,140,145,150,155,161,166,172,178,184,190,196,203,210,217,224,231,239,247,255
16
 
#define PWM_TOPS    64,64,64,1024,966,909,851,792,733,674,614,554,493,883,815,747,679,611,543,474,816,762,709,655,602,549,745,700,655,610,566,522,652,613,575,537,625,591,557,523,491,555,525,496,467,514,487,461,436,470,447,424,402,381,406,387,367,349,332,350,334,318,303,288,275,262,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 
17
 
 
18
 
//#define PWM1_LEVELS 255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
19
 
//#define PWM2_LEVELS 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,7,7,7,8,8,8,9,9,10,10,10,11,11,12,12,13,14,14,15,16,16,17,18,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,37,38,40,41,43,45,46,48,50,52,54,56,58,60,63,65,67,70,73,75,78,81,84,87,90,93,97,100,104,107,111,115,119,123,128,132,137,141,146,151,156,162,167,173,179,185,191,197,204,210,217,224,232,239,247,255
20
 
 
21
 
#define MAX_1x7135 80
22
 
#define HALFSPEED_LEVEL 3
23
 
#define QUARTERSPEED_LEVEL 3
24
 
 
25
 
#define RAMP_SMOOTH_FLOOR 3
26
 
#define RAMP_SMOOTH_CEIL 120
27
 
#define RAMP_DISCRETE_FLOOR RAMP_SMOOTH_FLOOR
 
14
#define _PWM1_LEVELS_ 1,2,4,6,9,12,15,19,23,28,34,41,48,55,64
 
15
#define _PWM1_TOPS_ 64,64,64,64,64,64,64,64,64,64,64,64,64,64,64
 
16
#define _PWM2_LEVELS_ 1,1,2,2,3,3,4,4,5,5,6,6,6,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,10,10,10,11,11,12,13,13,14,15,15,16,17,18,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,37,38,39,41,42,44,46,47,49,51,53,55,57,59,61,63,65,67,70,72,74,77,79,82,85,88,90,93,96,99,103,106,109,113,116,120,123,127,131,135,139,143,147,151,156,160,165,170,175,180,185,190,195,201,206,212,218,223,230,236,242,248,255
 
17
#define _PWM2_TOPS_ 3072,1960,2372,1476,2097,1572,1920,1570,1777,1524,1646,1454,1286,1369,1234,1115,1011,918,837,894,823,759,702,650,603,560,522,487,455,425,398,374,351,330,310,292,275,259,280,265,251,266,253,240,252,240,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
 
18
#define PWM1_LEVELS _PWM1_LEVELS_,_PWM2_TOPS_
 
19
#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,_PWM2_LEVELS_
 
20
#define PWM_TOPS    _PWM1_TOPS_,_PWM2_TOPS_
 
21
 
 
22
#define MAX_1x7135 15
 
23
#define HALFSPEED_LEVEL 15
 
24
#define QUARTERSPEED_LEVEL 15
 
25
#define DEFAULT_LEVEL 75
 
26
 
 
27
#define RAMP_SMOOTH_FLOOR 1
 
28
#define RAMP_SMOOTH_CEIL 150
 
29
// 1 25 50 [75] 100 125 150
 
30
#define RAMP_DISCRETE_FLOOR 1
28
31
#define RAMP_DISCRETE_CEIL RAMP_SMOOTH_CEIL
29
32
#define RAMP_DISCRETE_STEPS 7
30
33
 
31
34
// at Sofirn's request, use max (150) for the Simple UI ceiling
32
 
#define SIMPLE_UI_FLOOR RAMP_DISCRETE_FLOOR
 
35
// 15 48 [82] 116 150
 
36
#define SIMPLE_UI_FLOOR MAX_1x7135
33
37
#define SIMPLE_UI_CEIL 150
34
38
#define SIMPLE_UI_STEPS 5
35
39
 
 
40
// turn on at ~6 lm by default (level 50/150, or ramp step 2/5 or 3/7)
 
41
// (also sets lockout mode 2H to a useful level)
 
42
#define DEFAULT_MANUAL_MEMORY 50
 
43
// reset to default after being off for 10 minutes
 
44
#define DEFAULT_MANUAL_MEMORY_TIMER 10
 
45
 
36
46
// enable SOS in the blinkies group
37
47
#define USE_SOS_MODE
38
48
#define USE_SOS_MODE_IN_BLINKY_GROUP
46
56
 
47
57
// stop panicking at ~30% power
48
58
#define THERM_FASTER_LEVEL 105
49
 
#define MIN_THERM_STEPDOWN 66  // must be > end of dynamic PWM range
 
59
#define MIN_THERM_STEPDOWN 65  // must be > end of dynamic PWM range
50
60
 
51
61
// slow down party strobe; this driver can't pulse for too short a time
52
 
#define PARTY_STROBE_ONTIME 8
 
62
//#define PARTY_STROBE_ONTIME 8
 
63
#define STROBE_OFF_LEVEL 1  // keep the regulator chip on between pulses
53
64
 
54
65
// the default of 26 looks a bit flat, so increase it
55
66
#define CANDLE_AMPLITUDE 50
56
67
 
57
68
// enable 2 click turbo (replaces USE_2C_MAX_TURBO)
58
69
#define DEFAULT_2C_STYLE 1
 
70
 
 
71
// enable factory reset on 13H without loosening tailcap
 
72
#define USE_SOFT_FACTORY_RESET
 
73