Skip to content

Commit 8f5378b

Browse files
Johan Hedbergjhedberg
authored andcommitted
pwm: nrf5_sw: Fix configuration for nRF51
nRF51 boards require different values for the timer and ppi_base. Signed-off-by: Johan Hedberg <[email protected]>
1 parent 83978e6 commit 8f5378b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/pwm/pwm_nrf5_sw.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,15 @@ static int pwm_nrf5_sw_init(struct device *dev)
232232
* NOTE: If PA/LNA feature is enabled for nRF52x, then additional two PPI
233233
* channels 14-15 are used by BLE controller.
234234
*/
235-
/* FIXME: For nRF51, use .timer = NRF_TIMER1, .ppi_base = 7 */
236235
static const struct pwm_config pwm_nrf5_sw_0_config = {
236+
#if defined(CONFIG_SOC_SERIES_NRF51X)
237+
.timer = NRF_TIMER1,
238+
.ppi_base = 7,
239+
#else
237240
.timer = NRF_TIMER2,
238-
.gpiote_base = 0,
239241
.ppi_base = 14,
242+
#endif
243+
.gpiote_base = 0,
240244
.map_size = PWM_0_MAP_SIZE,
241245
};
242246

0 commit comments

Comments
 (0)