@@ -27,6 +27,10 @@ namespace mbed {
27
27
28
28
SPI::spi_peripheral_s SPI::_peripherals[SPI_COUNT];
29
29
30
+ SPI::spi_peripheral_s::spi_peripheral_s () : owner(NULL ) {
31
+
32
+ }
33
+
30
34
SPI::SPI (PinName mosi, PinName miso, PinName sclk, PinName ssel) :
31
35
_peripheral (NULL ),
32
36
#if DEVICE_SPI_ASYNCH && 0
@@ -81,7 +85,7 @@ struct SPI::spi_peripheral_s *SPI::_lookup(SPIName name, bool or_last) {
81
85
core_util_critical_section_enter ();
82
86
for (uint32_t idx = 0 ; idx < SPI_COUNT; idx++) {
83
87
if ((_peripherals[idx].name == name) ||
84
- ((_peripherals[idx].name == 0 ) && or_last)) {
88
+ ((_peripherals[idx].name == 0 ) && or_last)) {
85
89
result = &_peripherals[idx];
86
90
break ;
87
91
}
@@ -263,7 +267,7 @@ void SPI::start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer,
263
267
lock_deep_sleep ();
264
268
_acquire ();
265
269
_callback = callback;
266
-
270
+
267
271
spi_transfer_async (&_peripheral->spi , tx_buffer, tx_length, rx_buffer, rx_length, &_write_fill,
268
272
&SPI::irq_handler_asynch, this , _usage);
269
273
}
@@ -308,7 +312,7 @@ void SPI::dequeue_transaction()
308
312
void SPI::irq_handler_asynch (spi_t *obj, void *vctx, spi_async_event_t *event)
309
313
{
310
314
SPI *self = (SPI *)vctx;
311
-
315
+
312
316
self->unlock_deep_sleep ();
313
317
self->_callback .call (SPI_EVENT_ALL);
314
318
#if TRANSACTION_QUEUE_SIZE_SPI
0 commit comments