own config module

This commit is contained in:
2026-01-06 10:45:42 +01:00
parent fa6a19d1aa
commit 25b2c028b6
6 changed files with 239 additions and 154 deletions

View File

@ -10,17 +10,6 @@
#include <stdint.h>
#include <stdbool.h>
/**
* @brief Configuration structure stored in NVS
*/
typedef struct
{
int8_t led_pin_strip_a; // GPIO pin for LED strip A (-1 = not configured)
int8_t led_pin_strip_b; // GPIO pin for LED strip B (-1 = not configured)
int8_t pwm_pin; // GPIO pin for PWM input (-1 = not configured)
uint32_t magic; // Magic number to validate config (0xDEADBEEF)
} controller_config_t;
/**
* @brief Initialize the control system
* Loads configuration from NVS and initializes subsystems
@ -28,25 +17,6 @@ typedef struct
*/
esp_err_t control_init(void);
/**
* @brief Get current configuration
* @return Pointer to current configuration (read-only)
*/
const controller_config_t *control_get_config(void);
/**
* @brief Update configuration and save to NVS
* @param config New configuration
* @return ESP_OK on success
*/
esp_err_t control_update_config(const controller_config_t *config);
/**
* @brief Reset configuration to defaults
* @return ESP_OK on success
*/
esp_err_t control_reset_config(void);
/**
* @brief Set animation mode manually
* @param mode Animation mode (0-13)