From af10ce3427e8e33db977777c1b14a9335b19b4ee Mon Sep 17 00:00:00 2001 From: Atten Date: Sat, 22 Jan 2022 16:10:12 +0700 Subject: [PATCH] Add BOOT key for begin set Default Config --- include/main.h | 2 +- src/main.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/main.h b/include/main.h index 04e616b..0d418f9 100644 --- a/include/main.h +++ b/include/main.h @@ -10,7 +10,7 @@ #ifndef MAIN_H #define MAIN_H -#define VERSION "0.1" +#define VERSION "0.2" #define DEBUG //#define DEBUG_IS diff --git a/src/main.cpp b/src/main.cpp index 4a2311c..9d4f6e6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -444,13 +444,19 @@ void setup() Serial.println(); Serial.println("Start ESP32IGate V" + String(VERSION)); + Serial.println("Push BOOT for Factory Default config."); if (!EEPROM.begin(EEPROM_SIZE)) { Serial.println(F("failed to initialise EEPROM")); // delay(100000); } - delay(500); + delay(3000); + if (digitalRead(0) == LOW) { + defaultConfig(); + Serial.println("Manual Default configure!"); + delay(3000); + } //ตรวจสอบคอนฟิกซ์ผิดพลาด ptr = (byte *)&config;