Open
Description
Noticed a minor issue with the SPI class: destroying an SPI while async transfers are in progress will almost certainly result in out-of-bounds accesses, because (a) the transaction queue will still hold on to a pointer to the SPI class, and (b) the transfer completion callback for the current transfer will call into the class which is currently being deleted.
I think that this destructor should be updated to either abort any transfers which are currently in progress for this peripheral that refer to the current SPI class (probably hard), or just block until those transfers complete (not as hard, but will need some code changes, e.g. aborting will have to send an event)