Browse Source

Merge pull request #1984 from leptun/MK3_compile_error_fix_multiple_sheets_Windows

Fix compile error on Windows when multiple_sheets is merged
Marek Běl 4 years ago
parent
commit
4e3bf276ec
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Firmware/eeprom.h

+ 5 - 3
Firmware/eeprom.h

@@ -196,11 +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 !!!!!
 // !!!!!
@@ -224,6 +224,8 @@ static constexpr M500_conf * const EEPROM_M500_base = reinterpret_cast<M500_conf
 static_assert(((sizeof(M500_conf) + 20) < EEPROM_LAST_ITEM), "M500_conf address space conflicts with previous items.");
 #endif
 
+#undef EEPROM_SHEETS_BASE
+
 enum
 {
     EEPROM_MMU_CUTTER_ENABLED_enabled = 1,