Add to possibility to use GPIO 1&3
On ESP01, Serial won't be available anymore
This commit is contained in:
parent
aec6e58fed
commit
b9b8253adc
@ -9,6 +9,8 @@
|
|||||||
/* "Flash Size" Menu. Use espota.py to upload OTA */
|
/* "Flash Size" Menu. Use espota.py to upload OTA */
|
||||||
/* After passing in OTA mode, next boot will be in setup mode */
|
/* 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 <ESP8266WiFi.h>
|
#include <ESP8266WiFi.h>
|
||||||
#include <WiFiClient.h>
|
#include <WiFiClient.h>
|
||||||
@ -18,7 +20,11 @@
|
|||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
|
||||||
|
//#define ENABLE_EXTRA_GPIO
|
||||||
|
|
||||||
#define EEPROM_SIZE 512
|
#define EEPROM_SIZE 512
|
||||||
|
|
||||||
char eeprom[EEPROM_SIZE];
|
char eeprom[EEPROM_SIZE];
|
||||||
|
|
||||||
#define BOOTMODE_SETUP 0
|
#define BOOTMODE_SETUP 0
|
||||||
@ -279,7 +285,9 @@ void setup() {
|
|||||||
Serial.swap(); //Switch Serial on GPIO 13 & 15
|
Serial.swap(); //Switch Serial on GPIO 13 & 15
|
||||||
pinMode(3, INPUT_PULLUP);
|
pinMode(3, INPUT_PULLUP);
|
||||||
int txStatus = digitalRead(3);
|
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);
|
EEPROM.begin(EEPROM_SIZE);
|
||||||
readEEPROM(mode, &confSsid, &confPassword, &confHost);
|
readEEPROM(mode, &confSsid, &confPassword, &confHost);
|
||||||
|
Loading…
Reference in New Issue
Block a user