Skip to content

Commit 377002d

Browse files
ananglcarlescufi
authored andcommitted
drivers: spi_nrfx_spim: Fix handling of extended SPIM configuration (2)
This is a follow-up to commit 84f8235. Default initialization to 0 of the .dcx_pin field in the extended part of the SPIM configuration is incorrect, because this means that pin 0 should be used as the D/CX line. For the SPIM instance that provides the extended functionality, this results in undesired assignment of the pin 0, and for the other SPIM instances, this causes that their initialization fails with the NRFX_ERROR_NOT_SUPPORTED code. This commit sets this field to NRFX_SPIM_PIN_NOT_USED, to indicate that the D/CX line is not supposed to be used. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent db106a2 commit 377002d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spi_nrfx_spim.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,8 @@ static int spim_nrfx_pm_control(struct device *dev, u32_t ctrl_command,
362362

363363
#define SPI_NRFX_SPIM_EXTENDED_CONFIG(idx) \
364364
COND_CODE_1(IS_ENABLED(NRFX_SPIM_EXTENDED_ENABLED), \
365-
(COND_CODE_1(SPIM##idx##_FEATURE_RXDELAY_PRESENT, \
365+
(.dcx_pin = NRFX_SPIM_PIN_NOT_USED, \
366+
COND_CODE_1(SPIM##idx##_FEATURE_RXDELAY_PRESENT, \
366367
(.rx_delay = CONFIG_SPI_##idx##_NRF_RX_DELAY,), \
367368
())), \
368369
())

0 commit comments

Comments
 (0)