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