boards: Raspberry Pi pico pwm led adjustment
The Raspberry Pi pico defines PWM leds, but on the Raspberry Pi pico w-variant the gpio to the led is routed to the WiFi/Bluetooth module, thus the led is not available. Introduce a HAS_DT_PWM_LED define which allows devicetree overlays for the rpi_pico board to distinguish between board variants with a pwm controlled led, and those without. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
7277cae6fa
commit
037a3b52a4
|
@ -8,6 +8,10 @@
|
|||
|
||||
#include "rpi_pico-common.dtsi"
|
||||
|
||||
/* Only the rpi_pico/rp2040 has a pwm. */
|
||||
/* This define can be used to avoid sourcing board overlays when the PWM is not available */
|
||||
#define HAS_DT_PWM_LED 1
|
||||
|
||||
/ {
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/* The rpi_pico/rp2040/w doesn't have a pwm. */
|
||||
/* Use the HAS_DT_PWM defined by the based board to identify when this overlay is valid */
|
||||
#if HAS_DT_PWM_LED
|
||||
|
||||
&{/pwm_leds} {
|
||||
status = "okay";
|
||||
};
|
||||
|
@ -11,3 +15,5 @@
|
|||
divider-frac-4 = <15>;
|
||||
divider-int-4 = <255>;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,4 +8,3 @@ tests:
|
|||
- pwm
|
||||
depends_on: pwm
|
||||
harness: led
|
||||
platform_exclude: rpi_pico/rp2040/w
|
||||
|
|
Loading…
Reference in New Issue