increase chunk and baud rate
This commit is contained in:
parent
6686c1bfe0
commit
df09914bd3
3 changed files with 207 additions and 200 deletions
|
@ -655,8 +655,9 @@ bool ESPMegaDisplay::beginUpdate(size_t size)
|
|||
this->displayAdapter->read();
|
||||
this->displayAdapter->print("whmi-wri ");
|
||||
this->displayAdapter->print(size);
|
||||
this->displayAdapter->print(",115200,res0");
|
||||
this->displayAdapter->print(",921600,res0");
|
||||
this->sendStopBytes();
|
||||
this->displayAdapter->begin(921600);
|
||||
delay(1000);
|
||||
// If the display is ready, it will send a 0x05 byte
|
||||
// If it does, return true, otherwise return false
|
||||
|
@ -706,16 +707,23 @@ bool ESPMegaDisplay::writeUpdate(uint8_t *data, size_t size)
|
|||
if (otaBytesWritten % 4096 == 0)
|
||||
{
|
||||
unsigned long startTime = millis();
|
||||
bool ready = false;
|
||||
while (millis() - startTime < OTA_WAIT_TIMEOUT)
|
||||
{
|
||||
if (this->displayAdapter->available())
|
||||
{
|
||||
if (this->displayAdapter->read() == 0x05)
|
||||
{
|
||||
ESP_LOGV("ESPMegaDisplay", "LCD Update Subroutine is ready to receive data.");
|
||||
ready = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ready)
|
||||
{
|
||||
ESP_LOGE("ESPMegaDisplay", "LCD Update Subroutine failed to write data, display is not ready.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue