working ish slow OTA

This commit is contained in:
Siwat Sirichai 2024-01-15 21:12:02 +07:00
parent 0b1ca17351
commit 6686c1bfe0
5 changed files with 306 additions and 283 deletions

View file

@ -702,7 +702,7 @@ bool ESPMegaDisplay::writeUpdate(uint8_t *data, size_t size)
this->displayAdapter->write(data[i]);
// After every 4096 bytes, we have to wait for the display to send a 0x05 byte
// If it doesn't, return false
otaBytesWritten += size;
otaBytesWritten ++;
if (otaBytesWritten % 4096 == 0)
{
unsigned long startTime = millis();
@ -713,12 +713,9 @@ bool ESPMegaDisplay::writeUpdate(uint8_t *data, size_t size)
if (this->displayAdapter->read() == 0x05)
{
ESP_LOGV("ESPMegaDisplay", "LCD Update Subroutine is ready to receive data.");
return true;
}
}
}
ESP_LOGE("ESPMegaDisplay", "LCD Update Subroutine failed to write data.");
return false;
}
}
return true;