From 7d087e37b4411295621f525bd646bd2192708681 Mon Sep 17 00:00:00 2001 From: fvanroie Date: Mon, 9 Nov 2020 02:00:02 +0100 Subject: [PATCH] Add PSram gpio check --- src/hasp_gpio.cpp | 12 ++++++++---- src/main.cpp | 6 ++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/hasp_gpio.cpp b/src/hasp_gpio.cpp index f46176e3..62071069 100644 --- a/src/hasp_gpio.cpp +++ b/src/hasp_gpio.cpp @@ -15,8 +15,6 @@ uint8_t gpioUsedInputCount = 0; using namespace ace_button; static AceButton * button[HASP_NUM_INPUTS]; - - // An array of button pins, led pins, and the led states. Cannot be const // because ledState is mutable. hasp_gpio_config_t gpioConfig[HASP_NUM_GPIO_CONFIG] = { @@ -377,7 +375,13 @@ bool gpioIsSystemPin(uint8_t gpio) // To-do: // Network GPIOs // Serial GPIOs - // Tasmota GPIOs + // Tasmota Slave GPIOs + +#ifdef ARDUINO_ARCH_ESP32 + if(psramFound()) { + if((gpio >= 16) && (gpio <= 17)) return true; // PSRAM + } +#endif #ifdef ARDUINO_ARCH_ESP8266 if((gpio >= 6) && (gpio <= 11)) return true; // VSPI @@ -517,7 +521,7 @@ String gpioName(uint8_t gpio) // For ESP32 pin labels on boards use the GPIO number #ifdef ARDUINO_ARCH_ESP32 - return String(F("gpio")) + gpio; + return /*String(F("gpio")) +*/ String(gpio); #endif #ifdef ARDUINO_ARCH_ESP8266 diff --git a/src/main.cpp b/src/main.cpp index 743ce3f1..f76822a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,10 +17,8 @@ void setup() { /**************************** - * Constant initialzations + * Storage initializations ***************************/ - - /* Init Storage */ #if HASP_USE_EEPROM > 0 eepromSetup(); // Don't start at boot, only at write #endif @@ -183,5 +181,5 @@ void loop() mainLastLoopTime += 1000; } - delay(1); + delay(2); } \ No newline at end of file