File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/drivers_nrf/spi_master Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -447,6 +447,15 @@ static void spi_xfer(NRF_SPI_Type * p_spi,
447
447
448
448
nrf_spi_event_clear (p_spi , NRF_SPI_EVENT_READY );
449
449
450
+ /**
451
+ * 4/23/2018 Arm Mbed modification to Nordic SDK 14.2.
452
+ * Interrupts must be enabled before transmitting the first byte in asynchronous mode.
453
+ */
454
+ if (p_cb -> handler )
455
+ {
456
+ nrf_spi_int_enable (p_spi , NRF_SPI_INT_READY_MASK );
457
+ }
458
+
450
459
// Start the transfer by writing some byte to the TXD register;
451
460
// if TX buffer is not empty, take the first byte from this buffer,
452
461
// otherwise - use over-run character.
@@ -471,11 +480,11 @@ static void spi_xfer(NRF_SPI_Type * p_spi,
471
480
// and a new incoming byte was moved to the RXD register) and continue
472
481
// transaction until all requested bytes are transferred.
473
482
// In non-blocking mode - IRQ service routine will do this stuff.
474
- if ( p_cb -> handler )
475
- {
476
- nrf_spi_int_enable ( p_spi , NRF_SPI_INT_READY_MASK );
477
- }
478
- else
483
+ /**
484
+ * 4/23/2018 Arm Mbed modification to Nordic SDK 14.2.
485
+ * Interrupts must be enabled before transmitting the first byte in asynchronous mode.
486
+ */
487
+ if ( p_cb -> handler == NULL )
479
488
{
480
489
do {
481
490
while (!nrf_spi_event_check (p_spi , NRF_SPI_EVENT_READY )) {}
You can’t perform that action at this time.
0 commit comments