Skip to content

Commit

Permalink
drivers: spi_nrfx_spim: Fix handling of extended SPIM configuration
Browse files Browse the repository at this point in the history
Fill the `rx_delay` field in the SPIM configuration structure only when
the RXDELAY feature is present in a given SPIM instance, to prevent
compilation errors when some other SPIM instance is enabled together
with SPIM3.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
  • Loading branch information
anangl authored and dleach02 committed Dec 3, 2019
1 parent 58e2057 commit 84f8235
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/spi/spi_nrfx_spim.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,12 @@ static int spim_nrfx_pm_control(struct device *dev, u32_t ctrl_command,
}
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */

#if NRFX_CHECK(NRFX_SPIM_EXTENDED_ENABLED)
#define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \
.rx_delay = CONFIG_SPI_##idx##_NRF_RX_DELAY,
#else
#define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx)
#endif
#define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \
COND_CODE_1(IS_ENABLED(NRFX_SPIM_EXTENDED_ENABLED), \
(COND_CODE_1(SPIM##idx##_FEATURE_RXDELAY_PRESENT, \
(.rx_delay = CONFIG_SPI_##idx##_NRF_RX_DELAY,), \
())), \
())

#define SPI_NRFX_SPIM_DEVICE(idx) \
static int spi_##idx##_init(struct device *dev) \
Expand Down

0 comments on commit 84f8235

Please sign in to comment.