Add check on EEPROM size

This commit is contained in:
Mathieu Maret 2020-07-28 19:45:23 +02:00
parent 976a9a8053
commit 0e3afa391b
2 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,7 @@ int BME680BSECGetMeasure(float &t, float &p, float &h, float &iaq, float &iaqAcc
int BME680BSECSetup();
bool BME680BSECIsConnected();
#else // CONFIG_ENABLE_BME680_BSEC
#define BSEC_MAX_STATE_BLOB_SIZE 0
int BME680BSECGetMeasure(float &, float &, float &, float &, float &) {
return -1;
};

View File

@ -8,6 +8,10 @@
#define BME680_BSEC_EEPROM_ORIG (CONFIG_EEPROM_SIZE)
#if (CONFIG_EEPROM_SIZE + BSEC_MAX_STATE_BLOB_SIZE) >= SPI_FLASH_SEC_SIZE
#error "CONFIG_EEPROM_SIZE too big"
#endif
char eeprom[CONFIG_EEPROM_SIZE];
int EepromSaveConfig(productConfig &config) {