Skip to content

Commit 70431bb

Browse files
authored
Update SPI.cpp
1 parent 5f4bc38 commit 70431bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libraries/SPI/src/SPI.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121

2222
#include "SPI.h"
2323

24+
#if !CONFIG_DISABLE_HAL_LOCKS
25+
#define SPI_PARAM_LOCK() do {} while (xSemaphoreTake(paramLock, portMAX_DELAY) != pdPASS)
26+
#define SPI_PARAM_UNLOCK() xSemaphoreGive(paramLock)
27+
#else
28+
#define SPI_PARAM_LOCK()
29+
#define SPI_PARAM_UNLOCK()
30+
#endif
31+
2432
SPIClass::SPIClass(uint8_t spi_bus)
2533
:_spi_num(spi_bus)
2634
,_spi(NULL)

0 commit comments

Comments
 (0)