|
|
@ -53,9 +53,10 @@ void Led::changeAnimation(uint8_t num, uint16_t duration) { |
|
|
|
} |
|
|
|
|
|
|
|
void Led::setup(void) { |
|
|
|
pinMode(LED_PIN, OUTPUT); |
|
|
|
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS); |
|
|
|
FastLED.setBrightness(96); |
|
|
|
FastLED.setCorrection(TypicalLEDStrip); |
|
|
|
FastLED.setCorrection(0xFF60C0); |
|
|
|
fill_solid(leds, NUM_LEDS, CRGB::White); |
|
|
|
FastLED.show(); |
|
|
|
|
|
|
@ -63,7 +64,7 @@ void Led::setup(void) { |
|
|
|
xTaskCreate( |
|
|
|
&cTaskWrapper, /* Task function. */ |
|
|
|
"ledAnimationTask", /* String with name of task. */ |
|
|
|
1024, /* Stack size in words. */ |
|
|
|
2048, /* Stack size in words. */ |
|
|
|
this, /* Parameter passed as input of the task */ |
|
|
|
1, /* Priority of the task. */ |
|
|
|
&ledTaskHandle); /* Task handle. */ |
|
|
@ -73,7 +74,12 @@ void Led::animationTask(void* parameters) { |
|
|
|
while(true) { |
|
|
|
if (refresh != nullptr) { |
|
|
|
(*this.*refresh)(); |
|
|
|
FastLED.show(); |
|
|
|
try { |
|
|
|
FastLED.show(); |
|
|
|
} catch(...) { |
|
|
|
Serial.println("FastLED error"); |
|
|
|
this->setup(); |
|
|
|
} |
|
|
|
// EVERY_N_MILLISECONDS ( 20) { index++; }
|
|
|
|
index++; |
|
|
|
if (duration == 0) { |
|
|
|