Add dummy led driver to avoid crashes in case a non-supported board is built.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
parent
2e2b78445c
commit
95f02b6ea7
1 changed files with 17 additions and 0 deletions
|
|
@ -92,7 +92,24 @@ extern led_driver_t led_driver_ws2812;
|
|||
extern led_driver_t led_driver_neopixel;
|
||||
extern led_driver_t led_driver_pimoroni;
|
||||
|
||||
void led_driver_init_dummy() {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
void led_driver_color_dummy(uint8_t color, uint32_t led_brightness, float progress) {
|
||||
(void)color;
|
||||
(void)led_brightness;
|
||||
(void)progress;
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
led_driver_t led_driver_dummy = {
|
||||
.init = led_driver_init_dummy,
|
||||
.set_color = led_driver_color_dummy,
|
||||
};
|
||||
|
||||
void led_init() {
|
||||
led_driver = &led_driver_dummy;
|
||||
#ifndef ENABLE_EMULATION
|
||||
# // Guess default driver
|
||||
#ifdef PICO_DEFAULT_LED_PIN
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue