1
// config-default.h: Default configuration for Anduril.
2
// Copyright (C) 2017-2023 Selene ToyKeeper
3
// SPDX-License-Identifier: GPL-3.0-or-later
8
* This file specifies the default settings for Anduril.
10
* These settings can be overridden per build target, in cfg-*.h files...
11
* ... but most are not. So changing one here will make it change in
12
* almost every build target.
14
* Some configurable settings are also in other *.h files.
17
/********* User-configurable options *********/
18
// low voltage protection (also required for battery check mode)
21
// overheat protection
22
#define USE_THERMAL_REGULATION
23
#if (ATTINY==85) || (ATTINY==1634)
24
// sloppy temperature sensor needs bigger error margin
25
#define DEFAULT_THERM_CEIL 45 // try not to get hotter than this (in C)
27
// more accurate temperature sensor can regulate higher safely
28
#define DEFAULT_THERM_CEIL 50 // try not to get hotter than this (in C)
30
// Comment out to disable automatic calibration on factory reset
31
// - If so, be sure to set THERM_CAL_OFFSET to the correct calibration offset
32
// - Calibration can still be overridden in temperature check mode
33
// Or uncomment to use the default auto-calibrate on factory reset
35
// To determine THERM_CAL_OFFSET, comment out USE_THERM_AUTOCALIBRATE to
36
// disable auto-calibration, compile and flash, let flashlight rest at a known
37
// temperature, then enter temp check mode (do NOT enter calibration mode).
39
// THERM_CAL_OFFSET = known_temperature - temp_check_blinks + THERM_CAL_OFFSET
41
// (include THERM_CAL_OFFSET in sum as it might already be a non-zero number)
42
#define USE_THERM_AUTOCALIBRATE
44
// Include a simplified UI for non-enthusiasts?
48
///// Ramp mode options /////
50
// button timing for turning light on/off:
51
// B_PRESS_T: activate as soon as button is pressed
52
// B_RELEASE_T: activate when user lets go of button
53
// B_TIMEOUT_T: activate when we're sure the user won't double-click
54
// defaults are release on, timeout off
55
#define B_TIMING_ON B_RELEASE_T
56
#define B_TIMING_OFF B_TIMEOUT_T
58
// default ramp style: 0 = smooth, 1 = stepped
61
// smooth ramp speed: 1, 2, 3, 4, ... for 1X speed, 1/2, 1/3rd, 1/4th, ...
62
#define USE_RAMP_SPEED_CONFIG
64
// after ramping, how long until the direction resets to "up"?
65
#define AUTO_REVERSE_TIME (TICKS_PER_SECOND * 2 / 3)
67
// add runtime option for whether hold-from-off should ramp or stay at moon
68
#define USE_RAMP_AFTER_MOON_CONFIG
70
// short blip when crossing from "click" to "hold" from off
71
// (helps the user hit moon mode exactly, instead of holding too long
73
#define MOON_TIMING_HINT // only applies if B_TIMING_ON == B_PRESS_T
74
// short blips while ramping
75
#define BLINK_AT_RAMP_MIDDLE
76
//#define BLINK_AT_RAMP_FLOOR
77
#define BLINK_AT_RAMP_CEIL
78
//#define BLINK_AT_STEPS // whenever a discrete ramp mode is passed in smooth mode
80
// Uncomment for Anduril1 "Ramp 2C" behavior:
81
// - Ramp 2C goes to turbo (advanced UI) or ceiling (simple UI), like in Anduril1
82
// Or comment out to use Anduril2 behavior instead:
83
// - Ramp 2C goes to ceiling, unless already at ceiling or in simple UI.
84
// (Advanced UI ceiling 2C goes to turbo)
85
//#define USE_2C_MAX_TURBO
86
// Or uncomment to let the user decide which style they want:
87
#define USE_2C_STYLE_CONFIG
89
// 1 = A1 style: Off 2C = ceil, On 2C = turbo
90
// 2 = A2 style: Off 2C = ceil, On 2C = ceil, Ramped ceil 2C = turbo
91
// All styles allow momentary turbo in advanced UI
92
//#define DEFAULT_2C_STYLE 2 // default to Anduril 2 style
93
//#define DEFAULT_2C_STYLE_SIMPLE 0 // no turbo at all
95
// make the ramps configurable by the user
96
#define USE_RAMP_CONFIG
98
// adds a runtime option to switch between automatic memory (default)
99
// and manual memory (only available if compiled in)
100
// (manual memory makes 1-click-from-off start at the same level each time)
101
// (the level can be set explicitly with 10 clicks from on,
102
// or the user can go back to automatic with 10H)
103
#define USE_MANUAL_MEMORY
104
// if enabled, user can use "hybrid memory"
105
// The light will use automatic or manual memory level, depending on how long
106
// the light was off. Short off = automatic, long off = manual.
107
// This also remaps 10C/10H:
108
// - 10C toggles manual mem on/off at current level.
109
// - 10H configures the timer value.
110
#define USE_MANUAL_MEMORY_TIMER
112
// enable sunset timer (ramp-down and automatic shutoff)
113
// timer is available in regular ramp mode and candle mode
114
#define USE_SUNSET_TIMER
117
///// What to do when power is connected /////
118
// factory reset function erases user's runtime configuration in eeprom
119
#define USE_FACTORY_RESET
120
//#define USE_SOFT_FACTORY_RESET // only needed on models which can't use hold-button-at-boot
122
// dual-switch support (second switch is a tail clicky)
123
// (currently incompatible with factory reset)
124
//#define START_AT_MEMORIZED_LEVEL
127
///// extra modes (enable / disable / configure each mode) /////
129
// include a function to blink out the firmware version
130
#define USE_VERSION_CHECK
132
// enable the battery check mode (shows remaining charge) (requires USE_LVP)
133
#define USE_BATTCHECK_MODE
134
// battery readout style (pick one)
135
// TODO: allow VpT and 4-bar simultaneously,
136
// so one can be in "simple mode" and the other in "advanced mode"
137
#define BATTCHECK_VpT
138
//#define BATTCHECK_8bars // FIXME: breaks build
139
//#define BATTCHECK_4bars // FIXME: breaks build
140
// allow the user to calibrate the voltage readings?
141
// (adjust in 0.05V increments from -0.30V to +0.30V)
142
// (1 = -0.30V, 2 = -0.25V, ... 7 = 0V, ... 13 = +0.30V)
143
#define USE_VOLTAGE_CORRECTION
145
// enable beacon mode
146
#define USE_BEACON_MODE
148
// enable/disable various strobe modes
149
#define USE_BIKE_FLASHER_MODE
150
#define USE_PARTY_STROBE_MODE
151
#define USE_TACTICAL_STROBE_MODE
152
#define USE_LIGHTNING_MODE
153
#define USE_CANDLE_MODE
155
// boring strobes nobody really likes, but sometimes flashlight companies want
156
// (these replace the fun strobe group,
157
// so don't enable them at the same time as any of the above strobes)
158
//#define USE_POLICE_STROBE_MODE
160
//#define USE_SOS_MODE_IN_FF_GROUP // put SOS in the "boring strobes" mode
161
#define USE_SOS_MODE_IN_BLINKY_GROUP // put SOS in the blinkies mode group
163
// enable a mode for locking the light for safe carry
164
#define USE_LOCKOUT_MODE
165
// should lockout mode function as a momentary moon mode?
166
#define USE_MOON_DURING_LOCKOUT_MODE
167
// add an optional setting to lock the light after being off for a while
170
// enable momentary mode
171
#define USE_MOMENTARY_MODE
173
// enable tactical mode
174
#define USE_TACTICAL_MODE
177
// enable a shortcut for +10 in number entry mode
178
// (click for +1, hold for +10)
179
#define USE_NUMBER_ENTRY_PLUS10
181
// cut clock speed at very low modes for better efficiency
182
// (defined here so config files can override it)
183
#define USE_DYNAMIC_UNDERCLOCKING
185
// if the aux LEDs oscillate between "full battery" and "empty battery"
186
// while in "voltage" mode, enable this to reduce the amplitude of
187
// those oscillations
188
#if (ATTINY==1616) || (ATTINY==1634)
189
#define USE_LOWPASS_WHILE_ASLEEP
192
// if there's tint ramping, allow user to set it smooth or stepped
193
#define USE_STEPPED_TINT_RAMPING
194
#define DEFAULT_TINT_RAMP_STYLE 0 // smooth
196
// Use "smooth steps" to soften on/off and step changes
197
// on MCUs with enough room for extra stuff like this
198
#if (ATTINY==1616) || (ATTINY==1634)
199
#define USE_SMOOTH_STEPS
201
// 0 = none, 1 = smooth, 2+ = undefined
202
#define DEFAULT_SMOOTH_STEPS_STYLE 1
204
// by default, allow user to set the channel for each strobe-group mode
205
// (but allow disabling this feature per build)
206
#define USE_CHANNEL_PER_STROBE