Skip to content

Commit 3c4d713

Browse files
committed
OTA error code for WLEDMM_SAVE_FLASH
reduces program size by ~200 bytes
1 parent 52509ba commit 3c4d713

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wled00/wled_server.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,12 @@ void initServer()
331331
if (Update.hasError() || otaLock) {
332332
#ifdef ARDUINO_ARCH_ESP32
333333
if (Update.hasError()) {
334-
String updErr = Update.getError() == UPDATE_ERROR_ACTIVATE ? String("Could Not Activate The Firmware. (wrong board type?)") : String(Update.errorString());
334+
#if defined(WLEDMM_SAVE_FLASH)
335+
// not requesting the error string reduces flash size by 200 bytes
336+
String updErr = Update.getError() == UPDATE_ERROR_ACTIVATE ? String("Could Not Activate The Firmware. (wrong board type?)") : String("Error ") + String(Update.getError());
337+
#else
338+
String updErr = Update.getError() == UPDATE_ERROR_ACTIVATE ? String("Could Not Activate The Firmware. (wrong board type?)") : String(Update.errorString());
339+
#endif
335340
serveMessage(request, 500, F("Update failed!"), updErr + String("<br>Please check your file and retry!"), 254);
336341
} else
337342
serveMessage(request, 500, F("Update failed!"), F("Please check your file and retry! (OTA may be locked)"), 254);

0 commit comments

Comments
 (0)