ota update first version, with led management

This commit is contained in:
Emanuele Trabattoni
2025-08-05 11:56:13 +02:00
parent 80fda62344
commit 5bff567863
7 changed files with 212 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ namespace drivers
pinMode(c_ledPin, OUTPUT);
m_blinkTask = NULL;
m_flashTimer = NULL;
m_enforce = false;
}
Led::~Led()
@@ -20,9 +21,16 @@ namespace drivers
pinMode(c_ledPin, INPUT);
}
void Led::setEnforce(const bool enf)
{
m_enforce = enf;
}
void Led::setColor(const color_t color)
{
std::lock_guard<std::mutex> lock(m_ledMutex);
if (m_enforce)
return;
blinkStop();
m_colorDefault = color;
rgbLedWrite(c_ledPin, color.g, color.r, color.b);
@@ -58,6 +66,8 @@ namespace drivers
void Led::blinkColor(const uint16_t tOn, const uint16_t tOff, const color_t color)
{
std::lock_guard<std::mutex> lock(m_ledMutex);
if (m_enforce)
return;
blinkStop();
m_color1 = color;
m_color2 = {0, 0, 0};
@@ -69,6 +79,8 @@ namespace drivers
void Led::blinkAlternate(const uint16_t tOn, const uint16_t tOff, const color_t color1, const color_t color2)
{
std::lock_guard<std::mutex> lock(m_ledMutex);
if (m_enforce)
return;
blinkStop();
m_color1 = color1;
m_color2 = color2;