Browse Source

Fix references to Serial

fastled
Xose Pérez 7 years ago
parent
commit
3958c3eaad
2 changed files with 12 additions and 4 deletions
  1. +3
    -1
      code/espurna/espurna.ino
  2. +9
    -3
      code/espurna/web.ino

+ 3
- 1
code/espurna/espurna.ino View File

@ -99,7 +99,9 @@ void heartbeat() {
void hardwareSetup() { void hardwareSetup() {
EEPROM.begin(4096); EEPROM.begin(4096);
Serial.begin(SERIAL_BAUDRATE);
#ifdef DEBUG_PORT
DEBUG_PORT.begin(SERIAL_BAUDRATE);
#endif
#if not EMBEDDED_WEB #if not EMBEDDED_WEB
SPIFFS.begin(); SPIFFS.begin();
#endif #endif


+ 9
- 3
code/espurna/web.ino View File

@ -862,19 +862,25 @@ void _onUpgradeData(AsyncWebServerRequest *request, String filename, size_t inde
DEBUG_MSG_P(PSTR("[UPGRADE] Start: %s\n"), filename.c_str()); DEBUG_MSG_P(PSTR("[UPGRADE] Start: %s\n"), filename.c_str());
Update.runAsync(true); Update.runAsync(true);
if (!Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000)) { if (!Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000)) {
Update.printError(Serial);
#ifdef DEBUG_PORT
Update.printError(DEBUG_PORT);
#endif
} }
} }
if (!Update.hasError()) { if (!Update.hasError()) {
if (Update.write(data, len) != len) { if (Update.write(data, len) != len) {
Update.printError(Serial);
#ifdef DEBUG_PORT
Update.printError(DEBUG_PORT);
#endif
} }
} }
if (final) { if (final) {
if (Update.end(true)){ if (Update.end(true)){
DEBUG_MSG_P(PSTR("[UPGRADE] Success: %u bytes\n"), index + len); DEBUG_MSG_P(PSTR("[UPGRADE] Success: %u bytes\n"), index + len);
} else { } else {
Update.printError(Serial);
#ifdef DEBUG_PORT
Update.printError(DEBUG_PORT);
#endif
} }
} else { } else {
DEBUG_MSG_P(PSTR("[UPGRADE] Progress: %u bytes\r"), index + len); DEBUG_MSG_P(PSTR("[UPGRADE] Progress: %u bytes\r"), index + len);


Loading…
Cancel
Save