Skip to content

Commit 951e72b

Browse files
nordic-krchcarlescufi
authored andcommitted
drivers: flash: nrf_qspi_nor: Fix no multithreading configuration
File was failing to compile when multithreading was off. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
1 parent 8414e86 commit 951e72b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

drivers/flash/nrf_qspi_nor.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,19 @@ static void anomaly_122_uninit(const struct device *dev)
399399

400400
qspi_lock(dev);
401401

402-
#ifdef CONFIG_MULTITHREADING
403-
/* The last thread to finish using the driver uninit the QSPI */
404-
(void) k_sem_take(&dev_data->count, K_NO_WAIT);
405-
last = (k_sem_count_get(&dev_data->count) == 0);
406-
#endif
402+
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
403+
/* The last thread to finish using the driver uninit the QSPI */
404+
(void) k_sem_take(&dev_data->count, K_NO_WAIT);
405+
last = (k_sem_count_get(&dev_data->count) == 0);
406+
}
407407

408408
if (last) {
409409
while (nrfx_qspi_mem_busy_check() != NRFX_SUCCESS) {
410-
k_msleep(50);
410+
if (IS_ENABLED(CONFIG_MULTITHREADING)) {
411+
k_msleep(50);
412+
} else {
413+
k_busy_wait(50000);
414+
}
411415
}
412416

413417
nrf_gpio_cfg_output(QSPI_PROP_AT(csn_pins, 0));

0 commit comments

Comments
 (0)