Add ConfigPage size check at compile time

This commit is contained in:
Bruno Bousquet 2019-04-28 18:14:25 -04:00
parent 8d8062742b
commit 623b6577d8
1 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,7 @@
#define GLOBALS_H
#include <Arduino.h>
#include "table.h"
#include <assert.h>
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__)
#define BOARD_DIGITAL_GPIO_PINS 54
@ -994,4 +995,10 @@ extern byte cltCalibrationTable[CALIBRATION_TABLE_SIZE];
extern byte iatCalibrationTable[CALIBRATION_TABLE_SIZE];
extern byte o2CalibrationTable[CALIBRATION_TABLE_SIZE];
static_assert(sizeof(struct config2) == 128, "configPage2 size is not 128");
static_assert(sizeof(struct config4) == 128, "configPage4 size is not 128");
static_assert(sizeof(struct config6) == 128, "configPage6 size is not 128");
static_assert(sizeof(struct config9) == 192, "configPage9 size is not 192");
static_assert(sizeof(struct config10) == 192, "configPage10 size is not 192");
#endif // GLOBALS_H