Move string to progmem

flash: -84B
RAM: -4B
This commit is contained in:
Alex Voinea 2022-11-17 10:28:58 +01:00 committed by DRracer
parent 6edc71d0ae
commit bba5385a61
1 changed files with 2 additions and 2 deletions

View File

@ -215,10 +215,10 @@ static bool is_uninitialized(void* addr, uint8_t len)
bool Config_RetrieveSettings()
{
bool previous_settings_retrieved = true;
char ver[4]=EEPROM_VERSION;
static const char ver[4] PROGMEM = EEPROM_VERSION;
eeprom_read_block(reinterpret_cast<uint8_t*>(cs.version), reinterpret_cast<uint8_t*>(EEPROM_M500_base->version), sizeof(cs.version));
// SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]");
if (strncmp(ver,cs.version,3) == 0) // version number match
if (strncmp_P(ver, cs.version, sizeof(EEPROM_VERSION)) == 0) // version number match
{
eeprom_read_block(reinterpret_cast<uint8_t*>(&cs), reinterpret_cast<uint8_t*>(EEPROM_M500_base), sizeof(cs));
calculate_extruder_multipliers();