Skip to content

Commit 23fc8c6

Browse files
Donatien Garniermprse
authored andcommitted
Fix SPI drivers compatibility issues with Mbed 2
1 parent 4be235f commit 23fc8c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/SPI.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,12 @@ int SPI::write(const char *tx_buffer, int tx_length, char *rx_buffer, int rx_len
168168

169169
bool SPI::lock()
170170
{
171+
#ifdef MBED_CONF_RTOS_PRESENT
171172
return _peripheral->mutex->lock() == 0; // see cmsis_os2.h osOk == 0
173+
#else
174+
_peripheral->mutex->lock(); // No return value
175+
return true;
176+
#endif
172177
}
173178

174179
void SPI::unlock()

0 commit comments

Comments
 (0)