From a99cc4ec536d36b1cd5e557724cbf7287c975ec9 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Fri, 14 Apr 2023 02:37:57 +0200 Subject: [PATCH] Allow HASP_USE_GPIO37 and HASP_USE_GPIO38 to enable GPIO37 and 38 on some boards #453 --- src/dev/esp32/esp32.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/dev/esp32/esp32.cpp b/src/dev/esp32/esp32.cpp index aaaa3cb9..09615c0e 100644 --- a/src/dev/esp32/esp32.cpp +++ b/src/dev/esp32/esp32.cpp @@ -370,15 +370,20 @@ bool Esp32Device::is_system_pin(uint8_t pin) // SPID = IO11 or IO35 // SPIQ = IO13 or IO37 // SPIWP = IO14 or IO38 - if((pin >= 33) && (pin <= 38)) return true; // SPI flash - if(psramFound() &&(pin == 26)) return true; // PSRAM. IO26 = SPICS1, the rest are shared with the flash + if((pin >= 33) && (pin <= 38)) return true; // SPI flash + if(psramFound() && (pin == 26)) return true; // PSRAM. IO26 = SPICS1, the rest are shared with the flash #elif defined(ESP32S3) if((pin >= 22) && (pin <= 25)) return true; // unavailable if((pin >= 26) && (pin <= 32)) return true; // integrated SPI flash if((pin >= 33) && (pin <= 37)) return true; // octal flash or PSram #else if((pin >= 6) && (pin <= 11)) return true; // integrated SPI flash - if((pin == 37) || (pin == 38)) return true; // unavailable +#ifndef HASP_USE_GPIO37 + if(pin == 37) return true; // unavailable +#endif +#ifndef HASP_USE_GPIO38 + if(pin == 38) return true; // unavailable +#endif if(psramFound() && ((pin == 16) || (pin == 17))) return true; // PSRAM #endif @@ -442,8 +447,9 @@ long Esp32Device::get_uptime() #if defined(LANBONL8) // #warning Building for Lanbon L8 #include "dev/esp32/lanbonl8.h" -#elif defined(M5STACK) - // #warning Building for M5Stack core2 + +#elif defined(M5STACK) || defined(M5STACKLGFX) +#warning Building for M5Stack core2 #include "dev/esp32/m5stackcore2.h" #else dev::Esp32Device haspDevice;