From e4d0c779aa6a9e46b7165f38b2479788349332f8 Mon Sep 17 00:00:00 2001 From: Sascha Nitsch Date: Tue, 22 Mar 2022 06:55:00 +0100 Subject: [PATCH] raised max size for external EEPROM --- cimditprofile.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cimditprofile.cpp b/cimditprofile.cpp index 739fd58..a394e5c 100644 --- a/cimditprofile.cpp +++ b/cimditprofile.cpp @@ -675,7 +675,11 @@ void CimditProfile::printFlash() { m_eepromPosition = 0; uint16_t len = nextUInt16(); m_eepromPosition = 0; +#ifdef EXTERNAL_EEPROM + if (len < 32768) { +#else if (len < 1024) { +#endif uint8_t in; for (uint16_t i = 0; i < len; ++i) { in = nextUInt8(); @@ -707,11 +711,12 @@ void CimditProfile::writeFlash() { #ifdef EXTERNAL_EEPROM eepromWrite(m_eepromPosition++, len >> 8); eepromWrite(m_eepromPosition++, len & 255); + if (len < 32768) { #else EEPROM.write(m_eepromPosition++, len >> 8); EEPROM.write(m_eepromPosition++, len & 255); -#endif if (len < 1024) { +#endif for (uint16_t i = 2; i < len; ++i) { while ((buf[0] = Serial.read()) == -1) { delay(100); @@ -729,6 +734,9 @@ void CimditProfile::writeFlash() { Serial.println("written"); initProfiles(); } + m_displayState = DISPLAY_BLANK; // to enforce a redraw + showActiveProfile(); + return false; } void CimditProfile::setUserString(uint8_t timeout, const char* input) {