OTA Subroutine
This commit is contained in:
parent
142f0dd2e2
commit
1ecd97d821
2 changed files with 204 additions and 4 deletions
|
@ -2,6 +2,9 @@
|
|||
#include <Arduino.h>
|
||||
#include <map>
|
||||
|
||||
#define DISPLAY_MUTEX_TAKE_TIMEOUT 1000 // ms
|
||||
#define OTA_WAIT_TIMEOUT 1000 // ms
|
||||
|
||||
#define DISPLAY_FETCH_TIMEOUT 100 // ms
|
||||
#define DISPLAY_FETCH_RETRY_COUNT 5
|
||||
|
||||
|
@ -32,8 +35,13 @@ class ESPMegaDisplay
|
|||
void unregisterPageChangeCallback(uint16_t handle);
|
||||
uint16_t registerPayloadCallback(std::function<void(uint8_t, uint8_t*, uint8_t)> callback);
|
||||
void unregisterPayloadCallback(uint16_t handle);
|
||||
|
||||
void takeSerialMutex();
|
||||
void giveSerialMutex();
|
||||
bool beginOTA(size_t size);
|
||||
bool writeOTA(uint8_t* data, size_t size);
|
||||
void endOTA();
|
||||
protected:
|
||||
SemaphoreHandle_t serialMutex;
|
||||
uint8_t currentPage;
|
||||
uint8_t rx_buffer_index;
|
||||
char rx_buffer[256];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue