1
// load-save-config.h: Load/save/eeprom functions for Anduril.
2
// Copyright (C) 2017-2023 Selene ToyKeeper
3
// SPDX-License-Identifier: GPL-3.0-or-later
7
// remember stuff even after battery was changed
10
#ifdef START_AT_MEMORIZED_LEVEL
11
void save_config_wl();
14
// a struct to hold config values
19
// smooth vs discrete ramping
20
.ramp_style = RAMP_STYLE, // 0 = smooth, 1 = discrete
21
#ifdef USE_2C_STYLE_CONFIG
22
// 1 = A1 style, 2 = A2 style
23
.ramp_2c_style = DEFAULT_2C_STYLE,
26
// settings for each ramp (smooth, stepped, simple UI)
27
#ifdef USE_RAMP_CONFIG
52
// whether to enable the simplified interface or not
53
.simple_ui_active = SIMPLE_UI_ACTIVE,
54
#ifdef USE_2C_STYLE_CONFIG
55
// 0 = no turbo, 1 = A1 style, 2 = A2 style
56
.ramp_2c_style_simple = DEFAULT_2C_STYLE_SIMPLE,
60
#ifdef USE_RAMP_AFTER_MOON_CONFIG
61
.dont_ramp_after_moon = DEFAULT_DONT_RAMP_AFTER_MOON,
64
#ifdef USE_MANUAL_MEMORY
65
.manual_memory = DEFAULT_MANUAL_MEMORY,
66
#ifdef USE_MANUAL_MEMORY_TIMER
67
.manual_memory_timer = DEFAULT_MANUAL_MEMORY_TIMER,
71
///// channel modes / color modes
73
#if NUM_CHANNEL_MODES > 1
74
// current multi-channel mode
75
.channel_mode = DEFAULT_CHANNEL_MODE,
76
// user can take unwanted modes out of the rotation (bitmask)
77
.channel_modes_enabled = CHANNEL_MODES_ENABLED,
78
#ifdef USE_MANUAL_MEMORY
79
// reset w/ manual memory
80
.manual_memory_channel_mode = DEFAULT_CHANNEL_MODE,
82
#ifdef DEFAULT_BLINK_CHANNEL
83
// blink numbers in a specific channel (user configurable)
84
.blink_channel = DEFAULT_BLINK_CHANNEL,
87
#ifdef USE_CHANNEL_MODE_ARGS
88
// one byte of extra data per channel mode, like for tint value
89
.channel_mode_args = { CHANNEL_MODE_ARGS },
90
#ifdef USE_MANUAL_MEMORY
91
// remember and reset 1 extra parameter per channel mode (like tint)
92
.manual_memory_channel_args = { CHANNEL_MODE_ARGS },
94
#ifdef USE_STEPPED_TINT_RAMPING
95
.tint_ramp_style = DEFAULT_TINT_RAMP_STYLE,
99
///// Smooth animation between steps, and for on/off
100
#ifdef USE_SMOOTH_STEPS
101
.smooth_steps_style = DEFAULT_SMOOTH_STEPS_STYLE,
104
///// strobe / blinky mode settings
106
#ifdef USE_STROBE_STATE
107
.strobe_type = DEFAULT_STROBE,
108
#if (NUM_CHANNEL_MODES > 1) && defined(USE_CHANNEL_PER_STROBE)
109
// channel mode saved per strobe-group mode
110
#ifdef DEFAULT_STROBE_CHANNELS
111
.strobe_channels = { DEFAULT_STROBE_CHANNELS },
115
#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
116
// party / tactical strobe timing
117
// party strobe 24 Hz, tactical strobe 10 Hz
118
.strobe_delays = { 41, 67 },
120
#ifdef USE_BIKE_FLASHER_MODE
121
.bike_flasher_brightness = MAX_1x7135,
123
#ifdef USE_BEACON_MODE
128
///// voltage and temperature
130
#ifdef USE_VOLTAGE_CORRECTION
131
// same 0.05V units as fudge factor,
132
// but 7 is neutral, and the expected range is from 1 to 13
133
.voltage_correction = 7,
135
#ifdef USE_THERMAL_REGULATION
136
.therm_ceil = DEFAULT_THERM_CEIL,
137
.therm_cal_offset = 0,
142
#ifdef USE_INDICATOR_LED
143
// bits 2-3 control lockout mode
144
// bits 0-1 control "off" mode
145
// modes are: 0=off, 1=low, 2=high, 3=blinking (if TICK_DURING_STANDBY enabled)
146
.indicator_led_mode = INDICATOR_LED_DEFAULT_MODE,
148
#ifdef USE_AUX_RGB_LEDS
149
.rgb_led_off_mode = RGB_LED_OFF_DEFAULT,
150
.rgb_led_lockout_mode = RGB_LED_LOCKOUT_DEFAULT,
151
#ifdef USE_POST_OFF_VOLTAGE
152
// display voltage readout for a while after turning off?
153
.post_off_voltage = DEFAULT_POST_OFF_VOLTAGE_SECONDS,
157
///// misc other mode settings
160
.autolock_time = DEFAULT_AUTOLOCK_TIME,
162
#ifdef USE_TACTICAL_MODE
163
.tactical_levels = { TACTICAL_LEVELS },
166
///// hardware config / globals menu
168
#ifdef USE_JUMP_START
169
.jump_start_level = DEFAULT_JUMP_START_LEVEL,