From 7be17bb0c9b5c2bc4a6dfdfc0db363ba75e914e6 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 4 Nov 2024 16:31:02 +0100 Subject: [PATCH] fix(spi): ensure spi_t structure properly init Fixes #2543 Signed-off-by: Frederic Pillon --- libraries/SPI/src/SPI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/SPI/src/SPI.cpp b/libraries/SPI/src/SPI.cpp index 14f5b33f54..be638a2cc7 100644 --- a/libraries/SPI/src/SPI.cpp +++ b/libraries/SPI/src/SPI.cpp @@ -37,6 +37,7 @@ SPIClass SPI; */ SPIClass::SPIClass(uint32_t mosi, uint32_t miso, uint32_t sclk, uint32_t ssel) { + memset((void *)&_spi, 0, sizeof(_spi)); _spi.pin_miso = digitalPinToPinName(miso); _spi.pin_mosi = digitalPinToPinName(mosi); _spi.pin_sclk = digitalPinToPinName(sclk);