16 #include <avr/eeprom.h> 18 #define SETTINGS_COUNT (MEMORY_SIZE / MEMORY_SIZE_PER_SETTING) 19 #define SETTINGS_FIRST 1 20 #define SETTINGS_LAST (SETTINGS_FIRST + SETTINGS_COUNT - 1) 27 ButtonActionEnum ButtonActions[BUTTON_TYPE_COUNT];
37 uint8_t ActiveSettingIdx;
42 extern SettingsType GlobalSettings, StoredSettings;
44 INLINE
void SettingUpdate(
const void *addr, uint16_t size) {
45 #if ENABLE_EEPROM_SETTINGS 46 uintptr_t EEAddr = (uintptr_t)addr - (uintptr_t)&GlobalSettings + (uintptr_t)&StoredSettings;
49 eeprom_update_byte((uint8_t *)EEAddr, *(uint8_t *)addr);
53 eeprom_update_word((uint16_t *)EEAddr, *(uint16_t *)addr);
57 eeprom_update_block((uint8_t *)addr, (uint8_t *)EEAddr, size);
62 #define SETTING_UPDATE(x) SettingUpdate(&(x), sizeof(x)) 64 void SettingsLoad(
void);
65 void SettingsSave(
void);
67 void SettingsCycle(
void);
68 bool SettingsSetActiveById(uint8_t Setting);
69 uint8_t SettingsGetActiveById(
void);
70 void SettingsGetActiveByName(
char *SettingOut, uint16_t BufferSize);
71 bool SettingsSetActiveByName(
const char *Setting);
uint16_t ReaderThreshold
Timeout for timeout commands for this setting, in multiples of 100 ms.
Definition: Settings.h:33
LogModeEnum LogMode
Button actions for this setting.
Definition: Settings.h:28
Definition: Settings.h:26
LEDHookEnum LEDGreenFunction
Red LED function for this setting.
Definition: Settings.h:31
uint16_t PendingTaskTimeout
Green LED function for this setting.
Definition: Settings.h:32
ConfigurationEnum Configuration
Log mode for this setting.
Definition: Settings.h:29
LEDHookEnum LEDRedFunction
Active configuration for this setting.
Definition: Settings.h:30