Skip to content

Commit

Permalink
fixup! boards/particle-xenon: Don't provide LED[012] if they are used…
Browse files Browse the repository at this point in the history
… by SAUL
  • Loading branch information
chrysn committed Aug 26, 2024
1 parent c7d0285 commit 731a839
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions boards/common/particle-mesh/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,16 @@ extern "C" {
#define LED2_MASK (1 << 15)
#define LED_MASK (LED0_MASK | LED1_MASK | LED2_MASK)

/* Both are typically the case when saul_default is on, but strictly, it is
* those two that in combination make LEDs effectively unavailable to users.
* Not defining LEDx_ON has the effect of making LEDx_IS_PRESENT undefined. */
/* The typical SAUL setup for this board uses PWM to make the LEDs (really a
* single RGB LED) into a PWM controlled RGB LED entry. As a consequence of the
* PWM configuration, toggling the GPIO has no effect any more, and thus we do
* not define the macros so that no LEDs get picked up for LEDn_IS_PROVIDED.
* (The LEDn_ON etc macros will still be present and no-op as usual, but those
* explicitly checking for IS_PROVIDED will get an accurate picture).
*
* Both conditions are typically true when saul_default is on, but strictly, it
* is those two that in combination make LEDs effectively unavailable to users.
* */
#if !(IS_USED(MODULE_AUTO_INIT_SAUL) && IS_USED(MODULE_SAUL_PWM))

#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
Expand Down

0 comments on commit 731a839

Please sign in to comment.