From dbc603d5f6ea605f0dc086072b2141646e779a12 Mon Sep 17 00:00:00 2001 From: leptun Date: Tue, 9 Jul 2019 18:38:24 +0300 Subject: [PATCH 1/2] Fix compile error on windows addresses issue #1965 --- Firmware/eeprom.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index 7cc07fb20..2491e58db 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -196,10 +196,11 @@ static_assert(sizeof(Sheets) == EEPROM_SHEETS_SIZEOF, "Sizeof(Sheets) is not EEP #define EEPROM_NOZZLE_DIAMETER (EEPROM_CHECK_MODE-1) // uint8 #define EEPROM_NOZZLE_DIAMETER_uM (EEPROM_NOZZLE_DIAMETER-2) // uint16 -static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_NOZZLE_DIAMETER_uM - EEPROM_SHEETS_SIZEOF); +#define EEPROM_SHEETS_BASE (EEPROM_NOZZLE_DIAMETER_uM - EEPROM_SHEETS_SIZEOF) // Sheets +static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_SHEETS_BASE); //This is supposed to point to last item to allow EEPROM overrun check. Please update when adding new items. -#define EEPROM_LAST_ITEM ((uint16_t)EEPROM_Sheets_base) +#define EEPROM_LAST_ITEM EEPROM_SHEETS_BASE // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! From 712fb1cceb57d541d17a8b269f0d4fa22c61cf45 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 9 Jul 2019 19:19:59 +0200 Subject: [PATCH 2/2] #undef EEPROM_SHEETS_BASE so this internal define for compile-time checking only is not used outside of eeprom.h --- Firmware/eeprom.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index 2491e58db..9451ca65d 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -201,7 +201,6 @@ static Sheets * const EEPROM_Sheets_base = (Sheets*)(EEPROM_SHEETS_BASE); //This is supposed to point to last item to allow EEPROM overrun check. Please update when adding new items. #define EEPROM_LAST_ITEM EEPROM_SHEETS_BASE - // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! // !!!!! @@ -225,6 +224,8 @@ static constexpr M500_conf * const EEPROM_M500_base = reinterpret_cast