1
// load-save-config-fsm.h: FSM config for eeprom configuration in Anduril.
2
// Copyright (C) 2017-2023 Selene ToyKeeper
3
// SPDX-License-Identifier: GPL-3.0-or-later
8
// load into a custom RAM location instead of FSM's default byte array
9
#define EEPROM_OVERRIDE
17
// let FSM know this config struct exists
20
typedef struct Config {
24
#ifdef USE_2C_STYLE_CONFIG
25
uint8_t ramp_2c_style;
27
#ifdef USE_RAMP_CONFIG
28
uint8_t ramp_floors[NUM_RAMPS];
29
uint8_t ramp_ceils [NUM_RAMPS];
30
uint8_t ramp_stepss[NUM_RAMPS];
33
uint8_t simple_ui_active;
34
#ifdef USE_2C_STYLE_CONFIG
35
uint8_t ramp_2c_style_simple;
38
#ifdef USE_RAMP_AFTER_MOON_CONFIG
39
uint8_t dont_ramp_after_moon;
41
#ifdef USE_MANUAL_MEMORY
42
uint8_t manual_memory;
43
#ifdef USE_MANUAL_MEMORY_TIMER
44
uint8_t manual_memory_timer;
48
///// channel modes / color modes
49
#if NUM_CHANNEL_MODES > 1
51
uint16_t channel_modes_enabled;
52
#ifdef USE_MANUAL_MEMORY
53
uint8_t manual_memory_channel_mode;
55
#ifdef DEFAULT_BLINK_CHANNEL
56
uint8_t blink_channel;
59
#ifdef USE_CHANNEL_MODE_ARGS
60
// this is an array, needs a few bytes
61
uint8_t channel_mode_args[NUM_CHANNEL_MODES];
62
#ifdef USE_MANUAL_MEMORY
63
uint8_t manual_memory_channel_args[NUM_CHANNEL_MODES];
65
#ifdef USE_STEPPED_TINT_RAMPING
66
uint8_t tint_ramp_style;
70
///// Smooth animation between steps, and for on/off
71
#ifdef USE_SMOOTH_STEPS
72
uint8_t smooth_steps_style;
75
///// strobe / blinky mode settings
76
#ifdef USE_STROBE_STATE
78
#if (NUM_CHANNEL_MODES > 1) && defined(USE_CHANNEL_PER_STROBE)
79
uint8_t strobe_channels[NUM_STROBES];
82
#if defined(USE_PARTY_STROBE_MODE) || defined(USE_TACTICAL_STROBE_MODE)
83
uint8_t strobe_delays[2];
85
#ifdef USE_BIKE_FLASHER_MODE
86
uint8_t bike_flasher_brightness;
88
#ifdef USE_BEACON_MODE
89
uint8_t beacon_seconds;
92
///// voltage and temperature
93
#ifdef USE_VOLTAGE_CORRECTION
94
uint8_t voltage_correction;
96
#ifdef USE_THERMAL_REGULATION
98
int8_t therm_cal_offset;
102
#ifdef USE_INDICATOR_LED
103
uint8_t indicator_led_mode;
105
#ifdef USE_AUX_RGB_LEDS
106
uint8_t rgb_led_off_mode;
107
uint8_t rgb_led_lockout_mode;
108
#ifdef USE_POST_OFF_VOLTAGE
109
uint8_t post_off_voltage;
113
///// misc other mode settings
115
uint8_t autolock_time;
117
#ifdef USE_TACTICAL_MODE
118
uint8_t tactical_levels[3];
121
///// hardware config / globals menu
122
#ifdef USE_JUMP_START
123
uint8_t jump_start_level;
128
// auto-detect how many eeprom bytes
129
#define EEPROM_BYTES sizeof(Config)
131
// declare this so FSM can see it,
132
// but define its values in a file which loads later
135
#ifdef START_AT_MEMORIZED_LEVEL
136
#define USE_EEPROM_WL
137
#define EEPROM_WL_BYTES 1