diff --git a/code/espurna/espurna.ino b/code/espurna/espurna.ino index 3a6c2c2a..6d48e100 100644 --- a/code/espurna/espurna.ino +++ b/code/espurna/espurna.ino @@ -99,7 +99,9 @@ void heartbeat() { void hardwareSetup() { EEPROM.begin(4096); - Serial.begin(SERIAL_BAUDRATE); + #ifdef DEBUG_PORT + DEBUG_PORT.begin(SERIAL_BAUDRATE); + #endif #if not EMBEDDED_WEB SPIFFS.begin(); #endif diff --git a/code/espurna/web.ino b/code/espurna/web.ino index 1b9162ad..e78eb5ca 100644 --- a/code/espurna/web.ino +++ b/code/espurna/web.ino @@ -862,19 +862,25 @@ void _onUpgradeData(AsyncWebServerRequest *request, String filename, size_t inde DEBUG_MSG_P(PSTR("[UPGRADE] Start: %s\n"), filename.c_str()); Update.runAsync(true); if (!Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000)) { - Update.printError(Serial); + #ifdef DEBUG_PORT + Update.printError(DEBUG_PORT); + #endif } } if (!Update.hasError()) { if (Update.write(data, len) != len) { - Update.printError(Serial); + #ifdef DEBUG_PORT + Update.printError(DEBUG_PORT); + #endif } } if (final) { if (Update.end(true)){ DEBUG_MSG_P(PSTR("[UPGRADE] Success: %u bytes\n"), index + len); } else { - Update.printError(Serial); + #ifdef DEBUG_PORT + Update.printError(DEBUG_PORT); + #endif } } else { DEBUG_MSG_P(PSTR("[UPGRADE] Progress: %u bytes\r"), index + len);