From b9b8253adcadb48669bea3e1e0ceae49d1fd1207 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Fri, 4 Mar 2016 01:02:11 +0100 Subject: [PATCH] Add to possibility to use GPIO 1&3 On ESP01, Serial won't be available anymore --- .../WiFiAccessPointConfigurator.ino | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/WiFiAccessPointConfigurator/WiFiAccessPointConfigurator.ino b/WiFiAccessPointConfigurator/WiFiAccessPointConfigurator.ino index 56a2f2a..655c9ef 100644 --- a/WiFiAccessPointConfigurator/WiFiAccessPointConfigurator.ino +++ b/WiFiAccessPointConfigurator/WiFiAccessPointConfigurator.ino @@ -9,6 +9,8 @@ /* "Flash Size" Menu. Use espota.py to upload OTA */ /* After passing in OTA mode, next boot will be in setup mode */ +/* To Use GPIO 3 And 1, uncomment #define ENABLE_EXTRA_GPIO */ +/* but Serial will be available on GPIO 15 and 13 */ #include #include @@ -18,7 +20,11 @@ #include #include + +//#define ENABLE_EXTRA_GPIO + #define EEPROM_SIZE 512 + char eeprom[EEPROM_SIZE]; #define BOOTMODE_SETUP 0 @@ -279,7 +285,9 @@ void setup() { Serial.swap(); //Switch Serial on GPIO 13 & 15 pinMode(3, INPUT_PULLUP); int txStatus = digitalRead(3); - Serial.swap(); // Switch back +#ifndef ENABLE_EXTRA_GPIO + Serial.swap(); // Switch back on GPIO 1 & 3 +#endif EEPROM.begin(EEPROM_SIZE); readEEPROM(mode, &confSsid, &confPassword, &confHost);