Add ws2812 bringup logic to all RP2040 boards.

This commit is contained in:
curuvar 2022-07-06 23:05:01 -04:00 committed by Xiang Xiao
parent 3308f77e7c
commit 178ba6fbb4
2 changed files with 38 additions and 0 deletions

View File

@ -38,6 +38,16 @@
#include "rp2040_pwmdev.h"
#endif
#if defined(CONFIG_RP2040_BOARD_HAS_WS2812) && defined(CONFIG_WS2812)
#include "rp2040_ws2812.h"
#endif
#ifdef CONFIG_WS2812_HAS_WHITE
#define HAS_WHITE true
#else /* CONFIG_WS2812_HAS_WHITE */
#define HAS_WHITE false
#endif /* CONFIG_WS2812_HAS_WHITE */
/****************************************************************************
* Public Functions
****************************************************************************/
@ -398,5 +408,14 @@ int rp2040_bringup(void)
# endif
#endif
/* Initialize board neo-pixel */
#if defined(CONFIG_RP2040_BOARD_HAS_WS2812) && defined(CONFIG_WS2812)
rp2040_ws2812_setup("/dev/leds0",
CONFIG_RP2040_WS2812_GPIO_PIN,
CONFIG_WS2812_LED_COUNT,
HAS_WHITE);
#endif
return ret;
}

View File

@ -64,6 +64,16 @@
#include "rp2040_pwmdev.h"
#endif
#if defined(CONFIG_RP2040_BOARD_HAS_WS2812) && defined(CONFIG_WS2812)
#include "rp2040_ws2812.h"
#endif
#ifdef CONFIG_WS2812_HAS_WHITE
#define HAS_WHITE true
#else /* CONFIG_WS2812_HAS_WHITE */
#define HAS_WHITE false
#endif /* CONFIG_WS2812_HAS_WHITE */
/****************************************************************************
* Public Functions
****************************************************************************/
@ -477,5 +487,14 @@ int rp2040_bringup(void)
}
#endif
/* Initialize board neo-pixel */
#if defined(CONFIG_RP2040_BOARD_HAS_WS2812) && defined(CONFIG_WS2812)
rp2040_ws2812_setup("/dev/leds0",
CONFIG_RP2040_WS2812_GPIO_PIN,
CONFIG_WS2812_LED_COUNT,
HAS_WHITE);
#endif
return ret;
}