diff --git a/src/LedManagerTask.cpp b/src/LedManagerTask.cpp index c721d499..8ff50cd0 100644 --- a/src/LedManagerTask.cpp +++ b/src/LedManagerTask.cpp @@ -745,11 +745,11 @@ void LedManagerTask::setBrightness(uint8_t brightness) MicroTask.wakeTask(this); } -LedManagerTask ledManager; - #if defined(NEO_PIXEL_PIN) && defined(NEO_PIXEL_LENGTH) && defined(ENABLE_WS2812FX) -extern void ledManager_loop() +void LedManagerTask::service() { ws2812fx.service(); } -#endif \ No newline at end of file +#endif + +LedManagerTask ledManager; \ No newline at end of file diff --git a/src/LedManagerTask.h b/src/LedManagerTask.h index 8eb633e0..f08a5f21 100644 --- a/src/LedManagerTask.h +++ b/src/LedManagerTask.h @@ -78,16 +78,15 @@ class LedManagerTask : public MicroTasks::Task int getButtonPressed(); void setBrightness(uint8_t brightness); -}; - -extern LedManagerTask ledManager; - +#if defined(NEO_PIXEL_PIN) && defined(NEO_PIXEL_LENGTH) && defined(ENABLE_WS2812FX) // ------------------------------------------------------------------- // Perform the background status bar operations. Must be called in the main // loop function // ------------------------------------------------------------------- -#if defined(NEO_PIXEL_PIN) && defined(NEO_PIXEL_LENGTH) && defined(ENABLE_WS2812FX) -extern void ledManager_loop(); + void service(); #endif +}; + +extern LedManagerTask ledManager; -#endif // LED_MANAGER_TASK_H +#endif // LED_MANAGER_TASK_H \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 6fc75b79..f25928a0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -216,7 +216,8 @@ loop() { Profile_End(MicroTask, 10); #if defined(NEO_PIXEL_PIN) && defined(NEO_PIXEL_LENGTH) && defined(ENABLE_WS2812FX) - ledManager_loop(); + // Call ws2812fx service method to update ledbar effect + ledManager.service(); #endif if(OpenEVSE.isConnected())