sync
This commit is contained in:
28
firmware/include/settings.h
Normal file
28
firmware/include/settings.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef BUZZER_SETTINGS_H
|
||||
#define BUZZER_SETTINGS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/* Struktur für den direkten Lesezugriff aus dem RAM (Zero-Latency) */
|
||||
typedef struct {
|
||||
uint8_t audio_vol; /* 0..100 */
|
||||
bool play_norepeat; /* true = 1, false = 0 */
|
||||
uint32_t storage_interval_s; /* 0..7200 Sekunden */
|
||||
} app_settings_t;
|
||||
|
||||
/* Globale Instanz für den direkten Lesezugriff */
|
||||
extern app_settings_t app_settings;
|
||||
|
||||
/* Initialisiert das Settings-Subsystem, NVS und lädt die gespeicherten Werte */
|
||||
int app_settings_init(void);
|
||||
|
||||
/* Setter: Aktualisieren den RAM-Wert und starten/verlängern den Speichern-Timer */
|
||||
void app_settings_set_audio_vol(uint8_t vol);
|
||||
void app_settings_set_play_norepeat(bool norepeat);
|
||||
void app_settings_set_storage_interval(uint32_t interval_s);
|
||||
|
||||
/* Forciert sofortiges Speichern aller anstehenden Werte (Aufruf z.B. vor CMD_REBOOT) */
|
||||
void app_settings_save_pending_now(void);
|
||||
|
||||
#endif /* BUZZER_SETTINGS_H */
|
||||
Reference in New Issue
Block a user