From 3958c3eaadee0abaa8ed4a50462101772b8601b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 21 May 2017 11:55:13 +0200 Subject: [PATCH] Fix references to Serial --- code/espurna/espurna.ino | 4 +++- code/espurna/web.ino | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) 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);