diff --git a/WifiControlSensor/WifiControlSensor.ino b/WifiControlSensor/WifiControlSensor.ino index db624ee..0845f0b 100644 --- a/WifiControlSensor/WifiControlSensor.ino +++ b/WifiControlSensor/WifiControlSensor.ino @@ -190,8 +190,8 @@ void setup() { // Get GPIO 3 Status Serial.swap(); //Switch Serial on GPIO 13 & 15 - pinMode(3, INPUT_PULLUP); - int txStatus = digitalRead(3); + pinMode(CONFIG_SETUP_GPIO, INPUT_PULLUP); + int txStatus = digitalRead(CONFIG_SETUP_GPIO); #ifndef CONFIG_ENABLE_EXTRA_GPIO Serial.swap(); // Switch back on GPIO 1 & 3 #endif diff --git a/WifiControlSensor/config.h b/WifiControlSensor/config.h index 99ee7e3..ed121a3 100644 --- a/WifiControlSensor/config.h +++ b/WifiControlSensor/config.h @@ -46,3 +46,7 @@ #ifndef CONFIG_EEPROM_SIZE #define CONFIG_EEPROM_SIZE 256 #endif + +#ifndef CONFIG_SETUP_GPIO +#define CONFIG_SETUP_GPIO 3 +#endif diff --git a/WifiControlSensor/config_device.h b/WifiControlSensor/config_device.h index 78aac70..0e3481b 100644 --- a/WifiControlSensor/config_device.h +++ b/WifiControlSensor/config_device.h @@ -30,6 +30,8 @@ /* DEFAULT VALUE ALSO DEFINED IN CONFIG.H */ +//If this GPIO is LOW at boot, device will enter setup mode +//#define CONFIG_SETUP_GPIO 3 // Time to sleep between 2 webserver request (increase it reduce battery usage but increase latency) //#define CONFIG_WEB_DELAY_MS 100