fix SPI1 instances (#10983)

This commit is contained in:
Manuel authored and GitHub committed 2026-07-10 15:00:32 -05:00
1 parent 8abae90838
commit f52e2ea8ef
2 files changed
+12

No files matched your search

+8
View File
@@ -196,8 +196,16 @@ void setupNicheGraphics();
#endif
#if defined(HW_SPI1_DEVICE) && defined(ARCH_ESP32)
#if defined(HAS_SDCARD) && defined(SDCARD_USE_SPI1)
// Reuse FSCommon's SPI_HSPI instance to avoid double-initializing SPI2_HOST in arduino-esp32 3.x.
// Two SPIClass(HSPI) objects on the same bus cause the second spi_bus_initialize() to return
// ESP_ERR_INVALID_STATE, leaving the LoRa device handle invalid and blocking SPI transfers.
extern SPIClass SPI_HSPI;
SPIClass &SPI1 = SPI_HSPI;
#else
SPIClass SPI1(HSPI);
#endif
#endif
using namespace concurrency;