From 204740a52c8fdf974c250d26c24847815c9f7d0b Mon Sep 17 00:00:00 2001 From: William Emfinger Date: Tue, 9 Jul 2024 23:13:32 -0500 Subject: [PATCH] fix(led): Only install LED ISR once (#288) --- components/led/include/led.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/led/include/led.hpp b/components/led/include/led.hpp index 2036d2aed..bf8a5b81e 100644 --- a/components/led/include/led.hpp +++ b/components/led/include/led.hpp @@ -92,7 +92,11 @@ class Led : public BaseComponent { } logger_.info("Initializing the fade service"); - ledc_fade_func_install(0); + static bool fade_service_installed = false; + if (!fade_service_installed) { + ledc_fade_func_install(0); + fade_service_installed = true; + } ledc_cbs_t callbacks = {.fade_cb = &Led::cb_ledc_fade_end_event}; // we associate each channel with its own semaphore so that they can be