~gabe/flashlight-firmware/anduril2

« back to all changes in this revision

Viewing changes to Flintrock/bistro-hd/configs/config_biscotti-HD.h

  • Committer: Selene Scriven
  • Date: 2019-05-24 00:00:21 UTC
  • mto: (483.1.1 fsm)
  • mto: This revision was merged to the branch mainline in revision 443.
  • Revision ID: bzr@toykeeper.net-20190524000021-2f8tp4zvfe9aas7f
added GXB172 firmware from loneoceans (tiny841 boost driver)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef config_bistro_H
 
2
#define config_bistro_H
 
3
/*
 
4
 *  Firmware configuration header. 
 
5
 *
 
6
 * Bistro configuration file for biscotti build. 2017, (C) Flintrock (FR).
 
7
 * 
 
8
 * To work with tk-bistro and other compatible software.
 
9
 *
 
10
 * This program is free software: you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License as published by
 
12
 * the Free Software Foundation, either version 3 of the License, or
 
13
 * (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
22
 *
 
23
 */
 
24
 
 
25
 /* =========================================================================
 
26
 * Settings to modify per driver
 
27
 */
 
28
 
 
29
// Choose your MCU here, or in the build script
 
30
//  choices are now 13, 25, 45, and 85.  Yes, 45 and 85 are now different
 
31
 
 
32
#define NANJG105D_LAYOUT  // specify an I/O pin layout
 
33
 
 
34
#define MODEGROUPS_H "modegroups/modegroups-biscotti.h" // needs to be changed, no BLFA6 modegroup file included yet.
 
35
 
 
36
/*************************  Misc utility configs*************************************/
 
37
//#define VOLTAGE_CAL  // builds a driver that just blinks ADC reading, set the VOLTAGE mode below.
 
38
//#define STRIPPED // use for debugging, strips many features to make more space for debug compiler options or testing functions.
 
39
                   // customize it below
 
40
//#define OTSM_debug //may require STRIPPED to fit. //Will blink out number of wakes (see SLEEP_TIME_EXPONENT) on short clicks, before entering mode.
 
41
 
 
42
/************************************OFF-TIME CONFIGS**********************************/
 
43
 
 
44
//USE redundancy to make noinit off memory safer (if used at all) redundancy 4 requires 38 bytes.
 
45
// This is only used if OTC and OTSM are not used and you have a clicking switch.
 
46
#define USE_SAFE_PRESSES // enable
 
47
 
 
48
// redundancy 4 requires 38 bytes.
 
49
// redundancy level. Default is 4, but 3 could save some space, 2 has lower than 1 in 255 chance of failure:
 
50
                     // 3 has maybe 1 in 2,800 odds (based observations that 1's twice as probable as 0's)
 
51
                                         // 4 should have 1 in 69,000 odds of failure.
 
52
                                         // Failure rate is most likely per chip, not per click, but could be a little of both.
 
53
#define N_SAFE_BYTES 3
 
54
 
 
55
//#define OFFTIM3      // Use short/med/long off-time presses instead of just short/long
 
56
 
 
57
 
 
58
//#define USE_OTC // use off time cap. 
 
59
 
 
60
// Off-time sleep mode by -FR, thanks to flashy Mike and Mike C for early feasibility test with similar methods.
 
61
//#define USE_OTSM  // USE OTSM.  Pin must be defined in the layout too.
 
62
 
 
63
//#define OTSM_USES_OTC // use OTC cap for extra power on OTSM (sets it output high to charge up)
 
64
#define POWERSAVE // Also works without OTSM to reduce moon-mode drain. 
 
65
             // Squeeze out a bit more off-time by saving power during
 
66
             // shutoff detection (so at all times).  Implements ms resolution (could be less) idle sleeps in place of delay.
 
67
             // Seems to add at 0.5s of sleep at 3.1V 30uF cap, starting with only 0.75 that matters.  
 
68
                         // But at higher voltages, it's still only 0.5s additional, not multiplicative.
 
69
             // Also adds about 12 bytes that could be used for about two more mode groups instead :P
 
70
 
 
71
 
 
72
// Traditionally Cap values defined in tk-calibration
 
73
// But wake times in OTSM are not a calibration, just a configuration, so they go here.
 
74
// Times are in decimal seconds.  short (med) wakes are <, not = to wake_time_short(med)
 
75
#define SLEEP_TIME_EXPONENT 4   // OTSM clicky sleep will be increments of 16ms*2^STE  
 
76
                               // so 0 is 16, 1 is 32, 2 is 64, 3 is 128, 4 is 0.25s, 5 is 0.5s etc.
 
77
// To allow long click times use 4. For 1/8s resolution, use 3.
 
78
#define wake_time_short 0.5   // 0.5s : Short press is up to 0.5 s
 
79
#define wake_time_med   1.25   // this is limited by cap performance, but setting it high won't hurt 
 
80
                              // Since anything beyond the cap capacity will be read as long anyway.
 
81
                                                          // It's also the long-press off-threshold for e-switch operation.
 
82
 
 
83
/*****************************END OTSM CONGIGS*********************************/
 
84
 
 
85
//#define USE_ESWITCH  // pin must be defined in the layout too.
 
86
 
 
87
/**********************VOLTAGE CONFIG****************************************/
 
88
 
 
89
//#define VOLTAGE_MON         // Comment out to disable LVP
 
90
//You should leave one (but only one) of the next two uncommented.  
 
91
//#define READ_VOLTAGE_FROM_VCC  // inverted "internal" Vcc voltage monitoring
 
92
                               // Works well for 1S lights without worrying about resistor values.
 
93
#define READ_VOLTAGE_FROM_DIVIDER  // classic voltage reading
 
94
//#define REFERENCE_DIVIDER_READS_TO_VCC // default is 1.1V, but this is needed for divider reading with OTSM on the voltage pin.
 
95
                                         // This should normally be used with an LDO.  For 1S (non-LDO or 5.0VLDO) just avoid the problem with READ_VOLTAGE_FROM_VCC.
 
96
 
 
97
/***** Choose a battery indicator style (if enabled in modegroups)*******/
 
98
#define BATTCHECK_4bars  // up to 4 blinks
 
99
//#define BATTCHECK_8bars  // up to 8 blinks
 
100
//#define BATTCHECK_VpT  // Volts + tenths
 
101
 
 
102
/******thermal protection:  ***/
 
103
//#define TEMPERATURE_MON          // You can set starting temperature in the "maxtemp" setting in config options first boot options.
 
104
//#define USE_TEMP_CAL    // include a TEMP_CAL mode in the menu.
 
105
 
 
106
#if ATTINY==13  // thermal control depending on chip.
 
107
  #define USE_TURBO_TIMEOUT
 
108
  #define TURBO_TIMEOUT 45   // timeout in seconds.
 
109
#else
 
110
  #define TEMPERATURE_MON          // You can set starting temperature in the "maxtemp" setting in config options first boot options.
 
111
    #define USE_TEMP_CAL    // include a TEMP_CAL mode in the menu.  
 
112
    #define TEMP_STEP_DOWN //Requires TEMPERATURE_MON, Use step-down and tap-up instead of oscillate
 
113
      #define MINIMUM_TURBO_TIME  10 //Turbo will never run less than this long. Requires TEMP_STEP_DOWN
 
114
#endif
 
115
 
 
116
/*******Mode features***********/
 
117
//#define USE_MUGGLE_MODE  // compile in use of muggle mode
 
118
//#define USE_REVERSE_MODES  // compile in use of reverse modes
 
119
//#define USE_MOON  // compile in moon mode control
 
120
 
 
121
//#define USE_MUGGLE_MODE  // enable use of muggle mode
 
122
 
 
123
/*********Misc************/
 
124
#define INLINE_STROBE inline  // inline the strobe function, saves a surprisingly 
 
125
                              // large amount of space if only one simple strobe is used.
 
126
 
 
127
// Options for first bootup/default:
 
128
 
 
129
//#define USE_FIRSTBOOT //Enables reset menu option, only costs a couple of bytes.
 
130
 
 
131
#define INIT_MODEGROUP      0       // which mode group will be default, mode groups below start at zero, select the mode group you want and subtract one from the number to get it by defualt here
 
132
#define INIT_ENABLE_MOON    0       // Should we add moon to the set of modes?
 
133
#define INIT_REVERSE_MODES  0       // flip the mode order?
 
134
#define INIT_MEMORY         0       // mode memory, or not
 
135
#define INIT_OFFTIM3        1       // enable medium-press by default?
 
136
#define INIT_MUGGLE_MODE    0       // simple mode designed for mugglesotsm
 
137
#define INIT_LOCKSWITCH     0       // 0 => E-swtich enabled, 1 => locked.
 
138
#define INIT_MAXTEMP       88       // maximum temperature
 
139
 
 
140
#define BLINK_SPEED         750
 
141
 
 
142
 
 
143
// This is used to simplify the toggle function
 
144
// eliminating mode_override, using this threshold instead:
 
145
#define MINIMUM_OVERRIDE_MODE 245  // DO NOT EDIT.  DO NOT DEFINE ANY STROBES HIGER OR EQUAL TO THIS.
 
146
 
 
147
/******* Select Which Strobes to compile in**** *********************/
 
148
////Must still be connected to a mode group or hidden mode to be used, enabled but unused modes don't get optimized out
 
149
 
 
150
#define BATTCHECK        244      // Convenience code for battery check mode
 
151
//mode codes for strobes, must be less than MINIMUM_OVERRIDE_MODE
 
152
#define BIKING_STROBE    243     // Single flash biking strobe mode
 
153
//#define FULL_BIKING_STROBE     // Stutter bike strobe, uncomment to enable
 
154
//#define POLICE_STROBE    242     // Dual mode alternating strobe
 
155
//#define RANDOM_STROBE    241
 
156
#define SOS              240
 
157
//#define STROBE_8HZ       239
 
158
#define STROBE_10HZ      238
 
159
//#define STROBE_16HZ      237
 
160
//#define STROBE_OLD_MOVIE 236
 
161
//#define STROBE_CREEPY    235     // Creepy strobe mode, or really cool if you have a bunch of friends around
 
162
//#define RAMP             234     //Ramping "strobe"
 
163
 
 
164
 
 
165
#ifdef STRIPPED  // define what you want to remove in stripped mode
 
166
#undef TEMPERATURE_MON
 
167
#undef VOLTAGE_MON
 
168
#define NO_STROBES  // don't use strobes (not automatically stripped from modes though, result can be undefined) 
 
169
#undef USE_BATTCHECK
 
170
#endif
 
171
 
 
172
 
 
173
/**********************************************************************************
 
174
**********************END OF CONFIGURATION*****************************************
 
175
***********************************************************************************/
 
176
 
 
177
 
 
178
 
 
179
#endif
 
 
b'\\ No newline at end of file'