diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c b/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c index 225fbf2b47..ba8c7d27cb 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/spi_api.c @@ -141,11 +141,13 @@ static void master_event_handler(uint8_t spi_idx, if (p_event->type == NRF_DRV_SPI_EVENT_DONE) { p_spi_info->flag.busy = false; +#if DEVICE_SPI_ASYNCH if (p_spi_info->handler) { void (*handler)(void) = (void (*)(void))p_spi_info->handler; p_spi_info->handler = 0; handler(); } +#endif } } #define MASTER_EVENT_HANDLER(idx) \