Add BOOT key for begin set Default Config

This commit is contained in:
Atten 2022-01-22 16:10:12 +07:00
parent 4c68ffc6e2
commit af10ce3427
2 changed files with 8 additions and 2 deletions

View File

@ -10,7 +10,7 @@
#ifndef MAIN_H
#define MAIN_H
#define VERSION "0.1"
#define VERSION "0.2"
#define DEBUG
//#define DEBUG_IS

View File

@ -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;