Add PSram gpio check

This commit is contained in:
fvanroie 2020-11-09 02:00:02 +01:00
parent f11bc47c94
commit 7d087e37b4
2 changed files with 10 additions and 8 deletions

View File

@ -15,8 +15,6 @@ uint8_t gpioUsedInputCount = 0;
using namespace ace_button; using namespace ace_button;
static AceButton * button[HASP_NUM_INPUTS]; static AceButton * button[HASP_NUM_INPUTS];
// An array of button pins, led pins, and the led states. Cannot be const // An array of button pins, led pins, and the led states. Cannot be const
// because ledState is mutable. // because ledState is mutable.
hasp_gpio_config_t gpioConfig[HASP_NUM_GPIO_CONFIG] = { hasp_gpio_config_t gpioConfig[HASP_NUM_GPIO_CONFIG] = {
@ -377,7 +375,13 @@ bool gpioIsSystemPin(uint8_t gpio)
// To-do: // To-do:
// Network GPIOs // Network GPIOs
// Serial 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 #ifdef ARDUINO_ARCH_ESP8266
if((gpio >= 6) && (gpio <= 11)) return true; // VSPI 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 // For ESP32 pin labels on boards use the GPIO number
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
return String(F("gpio")) + gpio; return /*String(F("gpio")) +*/ String(gpio);
#endif #endif
#ifdef ARDUINO_ARCH_ESP8266 #ifdef ARDUINO_ARCH_ESP8266

View File

@ -17,10 +17,8 @@ void setup()
{ {
/**************************** /****************************
* Constant initialzations * Storage initializations
***************************/ ***************************/
/* Init Storage */
#if HASP_USE_EEPROM > 0 #if HASP_USE_EEPROM > 0
eepromSetup(); // Don't start at boot, only at write eepromSetup(); // Don't start at boot, only at write
#endif #endif
@ -183,5 +181,5 @@ void loop()
mainLastLoopTime += 1000; mainLastLoopTime += 1000;
} }
delay(1); delay(2);
} }