mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Improve OTA Update by Removing Delay and Immediate CAN Control
This commit is contained in:
parent
11886bec0d
commit
1ff1101566
2 changed files with 3 additions and 6 deletions
|
@ -45,12 +45,6 @@ void ElegantOTAClass::begin(ELEGANTOTA_WEBSERVER *server, const char * username,
|
|||
|
||||
// Pre-OTA update callback
|
||||
if (preUpdateCallback != NULL) preUpdateCallback();
|
||||
|
||||
// Sleep for 3 seconds to allow asynchronous preUpdateCallback tasks to complete
|
||||
unsigned long sleepStart = millis();
|
||||
while (millis() - sleepStart < 3000) { // Sleep for 3 second
|
||||
delay(1); // Yield to other tasks
|
||||
}
|
||||
|
||||
// Get header x-ota-mode value, if present
|
||||
OTA_Mode mode = OTA_MODE_FIRMWARE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue