~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to Tom_E/narsil/NarsilMulti/Setups_2HL_1C1S.h

  • Committer: Selene Scriven
  • Date: 2019-09-18 22:18:49 UTC
  • mfrom: (188.4.19 trunk)
  • Revision ID: bzr@toykeeper.net-20190918221849-7h4hcvl07ea3b6g6
merged updates from trunk, including gcc7/8/9 compatibility

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************************
 
2
 * Setups_2HL_1C1S.h - for dual LED headlamp (2HL) w/the Attin85 wired in on stock driver
 
3
 * =================
 
4
 *
 
5
 * Created: 3/18/2019 8:00 PM
 
6
 *  Author: Tom E
 
7
 ****************************************************************************************/
 
8
#ifndef SETTINGS_H_
 
9
#define SETTINGS_H_
 
10
 
 
11
//----------------------------------------------------------------------------------------
 
12
//                      Driver Board Settings
 
13
//----------------------------------------------------------------------------------------
 
14
#define OUT_CHANNELS 1                  // define the output channels as 1, 2 or 3
 
15
 
 
16
#define VOLTAGE_MON                             // Comment out to disable - ramp down and eventual shutoff when battery is low
 
17
//#define VOLT_MON_R1R2                 // uses external R1/R2 voltage divider, comment out for 1.1V internal ref
 
18
 
 
19
// For voltage monitoring on pin #7, only uncomment one of the two def's below:
 
20
//#define USING_220K    // for using the 220K resistor
 
21
//#define USING_360K    // for using a 360K resistor (LDO and 2S cells)
 
22
 
 
23
#define D1_DIODE 8                              // Drop over rev. polarity protection diode: no diode, 0.08V as a guess
 
24
 
 
25
// For 2 channel (FET+1) boards:
 
26
 //#define USING_3807135_BANK   // (default OFF) sets up ramping for 380 mA 7135's instead of a FET
 
27
 
 
28
// For 3 channel (triple) boards:
 
29
//#define TRIPLE_3_7135                 // Configure for 3 7135's
 
30
//#define TRIPLE_8_7135                 // Configure for 8 7135's
 
31
 
 
32
//#define ONBOARD_LED                           // Enable the LED support
 
33
//----------------------------------------------------------------------------------------
 
34
//----------------------------------------------------------------------------------------
 
35
 
 
36
 
 
37
//----------------------------------------------------------------------------------------
 
38
//                      Temperature Monitoring
 
39
//----------------------------------------------------------------------------------------
 
40
// Temperature Calibration Offset -
 
41
#define TEMP_CAL_OFFSET (3)
 
42
//    3   try this...
 
43
//    3   about right for the Zy-T11 #5
 
44
//    -2  about right for the Zy-T11 #4
 
45
//    -3  about right for the X1R (single)
 
46
//    4   about right for the C20C#2 (triple)
 
47
//   -11  about right for the C20C, kludgy driver (think MtnE modded)
 
48
//   -18 adjusted for the X7R DEL 17mm driver, piggybacked
 
49
//   -12  rough guess for the C8F 21700 triple
 
50
//   -12  rough guess for the X6R triple
 
51
//   -14  about for the TA driver for the M8
 
52
//   -3   try for SP03
 
53
//    1   about right for the C8F #1
 
54
//   -12  guess for the JM70 #2
 
55
//   -19  is about right for the Lumintop SD Mini, IOS proto driver
 
56
//   -3   Decided to use this for Q8 production
 
57
//   -6   BLF Q8 Round 3 - blinks 29C w/3 setting for 20C (68F) room temp
 
58
//   -2   try for the Manker U21 (LJ)
 
59
//   -2   works for the Warsun X60 (robo) using the 17 mm DEL driver
 
60
//   -1   try this for proto #1, OSHPark BLF Q8 driver
 
61
//    3   about right for BLF Q8 proto #2 and #3, reads ~20 for ~68F (18C)
 
62
//   -12  this is about right on the DEL DDm-L4 board in the UranusFire C818 light
 
63
//   -11  On the TA22 board in SupFire M2-Z, it's bout 11-12C too high,reads 35C at room temp, 23C=73.4F
 
64
//   -8   For the Manker U11 - at -11, reads 18C at 71F room temp (22C)
 
65
//   -2   For the Lumintop SD26 - at -2, reading a solid 19C-20C (66.2F-68F for 67F room temp)
 
66
 
 
67
#define DEFAULT_STEPDOWN_TEMP (55)      // default for stepdown temperature (50C=122F, 55C=131F)
 
68
// use 50C for smaller size hosts, or a more conservative level (SD26, U11, etc.)
 
69
// use 55C to 60C for larger size hosts, maybe C8 and above, or for a more aggressive setting
 
70
 
 
71
#define TEMP_ADJ_PERIOD 2812    // Over Temp adjustment frequency: 45 secs (in 16 msec ticks)
 
72
//----------------------------------------------------------------------------------------
 
73
//----------------------------------------------------------------------------------------
 
74
 
 
75
 
 
76
//----------------------------------------------------------------------------------------
 
77
#ifndef VOLT_MON_R1R2   // if using R1/R2, change the LVP settings in the calibration header file
 
78
#define BATT_LOW                          30    // Cell voltage to step light down = 3.0 V
 
79
#define BATT_CRIT                         28    // Cell voltage to shut the light off = 2.8 V
 
80
#endif
 
81
//----------------------------------------------------------------------------------------
 
82
 
 
83
 
 
84
//----------------------------------------------------------------------------------------
 
85
//                      Stored Configuration Setting Defaults
 
86
//----------------------------------------------------------------------------------------
 
87
#define DEF_RAMPING                     1               // 1: ramping, 0: mode sets
 
88
#if USING_3807135_BANK
 
89
 #define DEF_MOON_LEVEL         5               // 0..7, 0: disabled, usually set to 3 (350 mA) or 5 (380 mA) - 2 might work on a 350 mA
 
90
#else
 
91
 #define DEF_MOON_LEVEL         4               // 0..7, 0: disabled, usually set to 3 (350 mA) or 5 (380 mA) - 2 might work on a 350 mA
 
92
#endif
 
93
#define DEF_STEPDOWN_MODE       5               // 0=disabled, 1=thermal, 2=60s, 3=90s, 4=120s, 5=3min, 6=5min, 7=7min (3 mins is good for production)
 
94
#define DEF_BLINKY_MODE         2               // blinky mode config: 1=strobe only, 2=all blinkies, 0=disable
 
95
 
 
96
#define DEF_MODE_SET_IDX        3               // 0..11, mode set currently in effect, chosen by user (3=4 modes)
 
97
#define DEF_MOON_MODE           1               // 1: enable moonlight mode, 0: disable moon mode
 
98
#define DEF_HIGH_TO_LOW         0               // 1: highest to lowest, 0: modes go from lowest to highest
 
99
#define DEF_MODE_MEMORY         0               // 1: save/recall last mode set, 0: no memory
 
100
 
 
101
#define DEF_LOCATOR_LED         1               // Locator LED feature (ON when light is OFF) - 1=enabled, 0=disabled
 
102
#define DEF_BVLD_LED_ONLY       0               // BVLD (Battery Voltage Level Display) - 1=BVLD shown only w/onboard LED, 0=both primary and onboard LED's
 
103
#define DEF_ONBOARD_LED         1               // On Board LED support - 1=enabled, 0=disabled
 
104
//----------------------------------------------------------------------------------------
 
105
//----------------------------------------------------------------------------------------
 
106
 
 
107
 
 
108
//----------------------------------------------------------------------------------------
 
109
//                      Operational Settings Enable/Disable
 
110
//----------------------------------------------------------------------------------------
 
111
#define STARTUP_LIGHT_OFF               // (default ON) for ramping from power up, main light OFF, otherwise set to max
 
112
#define STARTUP_2BLINKS                 // enables the powerup/startup two blinks
 
113
#define LOCKOUT_ENABLE                  // (default ON) Enable the "Lock-Out" feature
 
114
#define TRIPLE_CLICK_BATT               // (default ON) enable a triple-click to display Battery status
 
115
#define RAMPING_REVERSE                 // (default ON) reverses ramping direction for every click&hold
 
116
#define OFFTIME_ENABLE 0                // 1: Do OFF time mode memory for Mode Sets on power switching (tailswitch), 0: disabled
 
117
 
 
118
//#define BLINK_ONLY_IND_LED    // blink the Ind. LED, not main LED for: startup, config settings, Enter/Exit lockout blinks
 
119
//#define ADV_RAMP_OPTIONS              // In ramping, enables "mode set" additional method for lock-out and battery voltage display, comment out to disable
 
120
//----------------------------------------------------------------------------------------
 
121
//----------------------------------------------------------------------------------------
 
122
 
 
123
 
 
124
//----------------------------------------------------------------------------------------
 
125
//                      Timed Settings
 
126
//----------------------------------------------------------------------------------------
 
127
#define RAMP_SWITCH_TIMEOUT 75 // make the up/dn ramp switch timeout 1.2 secs (same as IDLE_TIME)
 
128
 
 
129
#define STROBE_SPEED    14,41           // 14,41: 18Hz, 16,47: 16Hz, 20,60: 12.5Hz
 
130
 
 
131
#define SHORT_CLICK_DUR 18              // Short click max duration - for 0.288 secs
 
132
#define RAMP_MOON_PAUSE 23              // this results in a 0.368 sec delay, paused in moon mode
 
133
 
 
134
// One-Click Turn OFF option:
 
135
#define IDLE_TIME         75    // make the time-out 1.2 seconds (Comment out to disable)
 
136
 
 
137
// Switch handling:
 
138
#define LONG_PRESS_DUR    24    // Prev Mode time - long press, 24=0.384s (1/3s: too fast, 0.5s: too slow)
 
139
#define XLONG_PRESS_DUR   75    // strobe mode entry hold time - 75=1.2s, 68=1.09s (any slower it can happen unintentionally too much)
 
140
#define CONFIG_ENTER_DUR 200    // In Mode Sets Only: Config mode entry hold time - 200=3.2s, 160=2.5s
 
141
 
 
142
#define DBL_CLICK_TICKS   14    //  fast click time for enable/disable of Lock-Out, batt check,
 
143
                                                                                // and double/triple click timing (14=0.224s, was 16=0.256s)
 
144
 
 
145
#define ADC_DELAY        312    // Delay in ticks between low-batt ramp-downs (312=5secs, was 250=4secs)
 
146
//----------------------------------------------------------------------------------------
 
147
//----------------------------------------------------------------------------------------
 
148
 
 
149
 
 
150
//----------------------------------------------------------------------------------------
 
151
//                      Strobe/Blinky mode Configuration
 
152
//----------------------------------------------------------------------------------------
 
153
#define BATT_CHECK_MODE   80
 
154
#define TEMP_CHECK_MODE   81
 
155
#define FIRM_VERS_MODE    82
 
156
#define SPECIAL_MODES     90            // base/lowest value for special modes
 
157
#define STROBE_MODE               SPECIAL_MODES+1
 
158
//#define RANDOM_STROBE   SPECIAL_MODES+2       // not used for now...
 
159
#define POLICE_STROBE     SPECIAL_MODES+2
 
160
#define BIKING_STROBE     SPECIAL_MODES+3
 
161
#define BEACON_2S_MODE    SPECIAL_MODES+4
 
162
#define BEACON_10S_MODE   SPECIAL_MODES+5
 
163
 
 
164
// Custom define your blinky mode set here:
 
165
#define SPECIAL_MODES_SET       STROBE_MODE, POLICE_STROBE, BIKING_STROBE, BEACON_2S_MODE, BEACON_10S_MODE
 
166
//----------------------------------------------------------------------------------------
 
167
//----------------------------------------------------------------------------------------
 
168
 
 
169
#endif /* SETTINGS_H_ */
 
 
b'\\ No newline at end of file'