mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
188:bcfe06ba3d64
Parent:
187:0387e8f68319
Child:
189:f392fc9709a3
diff -r 0387e8f68319 -r bcfe06ba3d64 drivers/SPI.cpp
--- a/drivers/SPI.cpp	Thu Sep 06 13:40:20 2018 +0100
+++ b/drivers/SPI.cpp	Thu Nov 08 11:46:34 2018 +0000
@@ -41,9 +41,14 @@
     _write_fill(SPI_FILL_CHAR)
 {
     // No lock needed in the constructor
+    spi_init(&_spi, mosi, miso, sclk, ssel);
+}
 
-    spi_init(&_spi, mosi, miso, sclk, ssel);
-    _acquire();
+SPI::~SPI()
+{
+    if (_owner == this) {
+        _owner = NULL;
+    }
 }
 
 void SPI::format(int bits, int mode)