esp32-sk6812/include/UpdateServer.h
Thomas Kolb 8e9124c884 Avoid LED update glitches caused by flash access
Now any access to the flash, either through update writing or SPIFFS
access, is blocked while the LED stripes are written. This is
accomplished using a FreeRTOS semaphore.
2019-12-15 18:03:23 +01:00

28 lines
488 B
C++

#pragma once
#include <string>
#include <FreeRTOS.h>
#include <freertos/semphr.h>
#include "ChallengeResponse.h"
class UpdateServer
{
public:
enum UpdateTypes {
UT_FLASH = 0,
UT_SPIFFS = 1
};
UpdateServer(const std::string &pw, SemaphoreHandle_t *ledLockoutMutex);
void start(void);
private:
static void updateTask(void *arg);
ChallengeResponse m_cr;
SemaphoreHandle_t *m_ledLockoutMutex;
};