Skip to content

Commit

Permalink
fix(led): Only install LED ISR once (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
finger563 authored Jul 10, 2024
1 parent eae86fc commit 204740a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/led/include/led.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 204740a

Please sign in to comment.