clean up and update time on startup
This commit is contained in:
parent
94ed11c335
commit
2fd969fa93
2 changed files with 5 additions and 29 deletions
|
|
@ -12,6 +12,6 @@
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = wt32-eth01
|
board = wt32-eth01
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps = siwats/ESPMegaPROR3@^2.5.3
|
lib_deps = siwats/ESPMegaPROR3@^2.9.0
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
build_flags = -DCORE_DEBUG_LEVEL=0
|
build_flags = -DCORE_DEBUG_LEVEL=0
|
||||||
|
|
|
||||||
28
src/main.cpp
28
src/main.cpp
|
|
@ -104,15 +104,6 @@ void mqttSubscribeCallback()
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
// ------------ GPIO 2 Factory Reset Check ------------
|
|
||||||
gpio_config_t gpio_2_conf;
|
|
||||||
gpio_2_conf.intr_type = GPIO_INTR_DISABLE;
|
|
||||||
gpio_2_conf.mode = GPIO_MODE_INPUT;
|
|
||||||
gpio_2_conf.pull_up_en = GPIO_PULLUP_ENABLE;
|
|
||||||
gpio_config(&gpio_2_conf);
|
|
||||||
// If GPIO 2 is pulled low, clear the FRAM then reboot (Reset the device to factory defaults)
|
|
||||||
bool clear_fram = !gpio_get_level(GPIO_NUM_2);
|
|
||||||
// ------------ End GPIO 2 Factory Reset Check ------------
|
|
||||||
|
|
||||||
|
|
||||||
// ------------ Display Pre Initialization Routine ------------
|
// ------------ Display Pre Initialization Routine ------------
|
||||||
|
|
@ -132,10 +123,8 @@ void setup()
|
||||||
// Give flow of control to OS and scheduler
|
// Give flow of control to OS and scheduler
|
||||||
espmega.begin();
|
espmega.begin();
|
||||||
|
|
||||||
|
// Set time zone to UTC+7
|
||||||
// // ------------ Factory Reset Routine ------------
|
espmega.setTimezone("ICT-7");
|
||||||
// Disable factory reset for now
|
|
||||||
espmega.inputs.loop();
|
|
||||||
|
|
||||||
// set debounce time to 500 for pin 0-11
|
// set debounce time to 500 for pin 0-11
|
||||||
for (uint16_t i = 0; i < 12; i++)
|
for (uint16_t i = 0; i < 12; i++)
|
||||||
|
|
@ -143,19 +132,6 @@ void setup()
|
||||||
espmega.inputs.setDebounceTime(i, 500);
|
espmega.inputs.setDebounceTime(i, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (clear_fram)
|
|
||||||
// {
|
|
||||||
// Serial.print("boot_state.txt=\"Factory Resetting . . .\"");
|
|
||||||
// sendStopBytes();
|
|
||||||
// for (uint16_t i = 0; i < 32768; i++)
|
|
||||||
// {
|
|
||||||
// espmega.fram.write8(i, 0);
|
|
||||||
// }
|
|
||||||
// esp_restart();
|
|
||||||
// }
|
|
||||||
// // ------------ End Factory Reset Routine ------------
|
|
||||||
|
|
||||||
|
|
||||||
// ------------ IoT Module Initialization Routine ------------
|
// ------------ IoT Module Initialization Routine ------------
|
||||||
Serial.print("boot_state.txt=\"IoT Initializing . . .\"");
|
Serial.print("boot_state.txt=\"IoT Initializing . . .\"");
|
||||||
sendStopBytes();
|
sendStopBytes();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue