Correct version of EEPROM header for settings and write check for overtemperature

This commit is contained in:
2021-02-02 20:50:30 +01:00
parent 50ad31d58a
commit e614eaa23b
2 changed files with 15 additions and 1 deletions

View File

@@ -24,7 +24,7 @@
#include <string.h>
#define EEPROM_HEADER_MAGIC 0xA5
#define EEPROM_HEADER_COMP_VER 0xFF
#define EEPROM_HEADER_COMP_VER 0x01
static const uint8_t expected_header[2] = {EEPROM_HEADER_MAGIC, EEPROM_HEADER_COMP_VER};
@@ -36,6 +36,12 @@ struct eeprom_calibration_settings {
uint32_t crc;
};
#define EEPROM_OVER_TEMP_CONFIG_BASE_ADDR (EEPROM_CALIBRATION_BASE_ADDR + sizeof(struct eeprom_calibration_settings))
struct eeprom_over_temp_config {
float over_temperature;
float over_temperature_redundant;
};
static bool check_eeprom_header(void)
{
uint8_t header[2] = {0};