Skip to content

Commit 5b2e387

Browse files
authored
add missing code
1 parent 70431bb commit 5b2e387

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/SPI/src/SPI.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
5656
if(!_spi) {
5757
return;
5858
}
59+
#if !CONFIG_DISABLE_HAL_LOCKS
60+
if(paramLock==NULL){
61+
paramLock = xSemaphoreCreateMutex();
62+
if(paramLock==NULL) return; // fail to create mutex so abort initialization
63+
}
64+
#endif
5965

6066
if(sck == -1 && miso == -1 && mosi == -1 && ss == -1) {
6167
#if CONFIG_IDF_TARGET_ESP32S2

0 commit comments

Comments
 (0)