use sha256 instead of magic pattern
This commit is contained in:
@ -11,18 +11,19 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define CONFIG_HASH_LEN 32 // SHA256
|
||||
/**
|
||||
* @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 led_count_strip_a; // LED count for LED strip A (-1 = not configured)
|
||||
int8_t led_count_strip_b; // LED count for LED strip B (-1 = not configured)
|
||||
int8_t pwm_pin; // GPIO pin for PWM input (-1 = not configured)
|
||||
int8_t localBtn_pin; // GPIO pin for local btn input (-1 = not configured)
|
||||
uint32_t magic; // Magic number to validate config (0xDEADBEEF) //TODO: use sha256
|
||||
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 led_count_strip_a; // LED count for LED strip A (-1 = not configured)
|
||||
int8_t led_count_strip_b; // LED count for LED strip B (-1 = not configured)
|
||||
int8_t pwm_pin; // GPIO pin for PWM input (-1 = not configured)
|
||||
int8_t localBtn_pin; // GPIO pin for local btn input (-1 = not configured)
|
||||
uint8_t hash[CONFIG_HASH_LEN]; // SHA256 Hash of config
|
||||
} config_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user