Skip to content

Commit 64575fe

Browse files
authored
Merge pull request #10480 from kjbracey-arm/spi_prime
SPI: Prime asynch transaction buffer on construction
2 parents a2cde2e + 3fbad10 commit 64575fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/SPI.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ void SPI::_do_construct()
8383
_peripheral->name = name;
8484
}
8585
core_util_critical_section_exit();
86+
87+
#if DEVICE_SPI_ASYNCH && TRANSACTION_QUEUE_SIZE_SPI
88+
// prime the SingletonPtr, so we don't have a problem trying to
89+
// construct the buffer if asynch operation initiated from IRQ
90+
_peripheral->transaction_buffer.get();
91+
#endif
8692
// we don't need to _acquire at this stage.
8793
// this will be done anyway before any operation.
8894
}

0 commit comments

Comments
 (0)