Fix material_preset reference issue

This commit is contained in:
Scott Lahteine 2020-07-16 21:02:52 -05:00
parent 6b0e8e5fd5
commit b880712889
2 changed files with 30 additions and 31 deletions

View File

@ -20,7 +20,7 @@
*
*/
#include "../inc/MarlinConfigPre.h"
#include "../inc/MarlinConfig.h"
#ifdef LED_BACKLIGHT_TIMEOUT
#include "../feature/leds/leds.h"
@ -86,6 +86,32 @@ MarlinUI ui;
}
#endif
#if PREHEAT_COUNT
preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load()
PGM_P MarlinUI::get_preheat_label(const uint8_t m) {
#ifdef PREHEAT_1_LABEL
static PGMSTR(preheat_0_label, PREHEAT_1_LABEL);
#endif
#ifdef PREHEAT_2_LABEL
static PGMSTR(preheat_1_label, PREHEAT_2_LABEL);
#endif
#ifdef PREHEAT_3_LABEL
static PGMSTR(preheat_2_label, PREHEAT_3_LABEL);
#endif
#ifdef PREHEAT_4_LABEL
static PGMSTR(preheat_3_label, PREHEAT_4_LABEL);
#endif
#ifdef PREHEAT_5_LABEL
static PGMSTR(preheat_4_label, PREHEAT_5_LABEL);
#endif
#define _PLBL(N) preheat_##N##_label,
static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT(PREHEAT_COUNT, _PLBL) };
return (PGM_P)pgm_read_ptr(&preheat_labels[m]);
}
#endif
#if HAS_SPI_LCD
#if HAS_GRAPHICAL_LCD
@ -149,33 +175,6 @@ millis_t MarlinUI::next_button_update_ms; // = 0
volatile int8_t encoderDiff; // Updated in update_buttons, added to encoderPosition every LCD update
#endif
#if PREHEAT_COUNT
preheat_t MarlinUI::material_preset[PREHEAT_COUNT]; // Initialized by settings.load()
PGM_P MarlinUI::get_preheat_label(const uint8_t m) {
#ifdef PREHEAT_1_LABEL
static PGMSTR(preheat_0_label, PREHEAT_1_LABEL);
#endif
#ifdef PREHEAT_2_LABEL
static PGMSTR(preheat_1_label, PREHEAT_2_LABEL);
#endif
#ifdef PREHEAT_3_LABEL
static PGMSTR(preheat_2_label, PREHEAT_3_LABEL);
#endif
#ifdef PREHEAT_4_LABEL
static PGMSTR(preheat_3_label, PREHEAT_4_LABEL);
#endif
#ifdef PREHEAT_5_LABEL
static PGMSTR(preheat_4_label, PREHEAT_5_LABEL);
#endif
#define _PLBL(N) preheat_##N##_label,
static PGM_P const preheat_labels[PREHEAT_COUNT] PROGMEM = { REPEAT(PREHEAT_COUNT, _PLBL) };
return (PGM_P)pgm_read_ptr(&preheat_labels[m]);
}
#endif
#if ENABLED(SDSUPPORT)
#include "../sd/cardreader.h"

View File

@ -43,15 +43,15 @@
//#define FLASH_EEPROM_EMULATION
// I2C
//#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0
#define IIC_BL24CXX_EEPROM // EEPROM on I2C-0 used only for display settings
#if ENABLED(IIC_BL24CXX_EEPROM)
#define IIC_EEPROM_SDA PA11
#define IIC_EEPROM_SCL PA12
#define MARLIN_EEPROM_SIZE 0x4000 // 16Kb (24c16)
#else
#define SDCARD_EEPROM_EMULATION // SD EEPROM was in the original build, so...
#endif
#define SDCARD_EEPROM_EMULATION // SD EEPROM until all EEPROM is BL24CXX
// SPI
//#define SPI_EEPROM // EEPROM on SPI-0
//#define SPI_CHAN_EEPROM1 ?