Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SPI: Prime asynch transaction buffer on construction
SPI peripherals' asynch transaction buffers are now wrapped by SingletonPtr, which needs to take the singleton_lock Mutex when first accessed. If it was first accessed by an asynch transaction started from IRQ, that would not be possible. Add a SingletonPtr::get() call to the SPI construction process so that the peripheral's buffer is fully constructed before any SPI methods can be called, meaning asynch methods won't fail from IRQ. (Other pre-existing synchronisation issues with async remain, but this avoids a new trap in Mbed OS 5.12).
- Loading branch information