Browse Source

OTA Progress Debug Msg only on change

ech1560
Philipp Bauer 6 years ago
parent
commit
3598ce1850
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