Browse Source

Merge pull request #1092 from BauerPh/OTAProgressUpdate

OTA Progress Debug Msg only on change
ech1560
Xose Pérez 6 years ago
committed by GitHub
parent
commit
f18c901c3f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      code/espurna/ota.ino

+ 8
- 2
code/espurna/ota.ino View File

@ -238,8 +238,14 @@ void otaSetup() {
deferredReset(100, CUSTOM_RESET_OTA);
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
DEBUG_MSG_P(PSTR("[OTA] Progress: %u%%\r"), (progress / (total / 100)));
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
static unsigned int _progOld;
unsigned int _prog = (progress / (total / 100));
if (_prog != _progOld) {
DEBUG_MSG_P(PSTR("[OTA] Progress: %u%%\r"), _prog);
_progOld = _prog;
}
});
ArduinoOTA.onError([](ota_error_t error) {


Loading…
Cancel
Save