|
18 | 18 | #include <esp_task_wdt.h>
|
19 | 19 |
|
20 | 20 | #ifdef NEOPIXEL_ENABLE
|
21 |
| - #include <FastLED.h> |
22 |
| - |
23 | 21 | #define LED_INDICATOR_SET(indicator) ((Led_Indicators) |= (1u << ((uint8_t) indicator)))
|
24 | 22 | #define LED_INDICATOR_IS_SET(indicator) (((Led_Indicators) & (1u << ((uint8_t) indicator))) > 0u)
|
25 | 23 | #define LED_INDICATOR_CLEAR(indicator) ((Led_Indicators) &= ~(1u << ((uint8_t) indicator)))
|
@@ -108,7 +106,7 @@ bool Led_LoadSettings(LedSettings &settings) {
|
108 | 106 |
|
109 | 107 | // get reverse rotation from NVS
|
110 | 108 | #ifdef NEOPIXEL_REVERSE_ROTATION
|
111 |
| - const bool defReverseRotation = NEOPIXEL_REVERSE_ROTATION; |
| 109 | + const bool defReverseRotation = true; |
112 | 110 | #else
|
113 | 111 | const bool defReverseRotation = false;
|
114 | 112 | #endif
|
@@ -359,6 +357,7 @@ static void Led_Task(void *parameter) {
|
359 | 357 | FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, numIndicatorLeds + numControlLeds).setCorrection(TypicalSMD5050);
|
360 | 358 | FastLED.setBrightness(gLedSettings.Led_Brightness);
|
361 | 359 | FastLED.setDither(DISABLE_DITHER);
|
| 360 | + FastLED.setMaxRefreshRate(200); // limit LED refresh rate to 200Hz (less likely to cause flickering) |
362 | 361 |
|
363 | 362 | LedAnimationType activeAnimation = LedAnimationType::NoNewAnimation;
|
364 | 363 | LedAnimationType nextAnimation = LedAnimationType::NoNewAnimation;
|
@@ -537,6 +536,9 @@ static void Led_Task(void *parameter) {
|
537 | 536 | // get the time to wait and delay the task
|
538 | 537 | if ((animationTimer > 0) && (animationTimer < taskDelay)) {
|
539 | 538 | taskDelay = animationTimer;
|
| 539 | + if (taskDelay < 5) { |
| 540 | + taskDelay = 5; // minimum delay |
| 541 | + } |
540 | 542 | }
|
541 | 543 | animationTimer -= taskDelay;
|
542 | 544 | vTaskDelay(portTICK_PERIOD_MS * taskDelay);
|
|
0 commit comments