clean up and update time on startup

This commit is contained in:
reaw55 2024-05-22 01:52:57 +07:00
parent 94ed11c335
commit 2fd969fa93
2 changed files with 5 additions and 29 deletions

View file

@ -12,6 +12,6 @@
platform = espressif32
board = wt32-eth01
framework = arduino
lib_deps = siwats/ESPMegaPROR3@^2.5.3
lib_deps = siwats/ESPMegaPROR3@^2.9.0
monitor_speed = 115200
build_flags = -DCORE_DEBUG_LEVEL=0

View file

@ -104,15 +104,6 @@ void mqttSubscribeCallback()
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 ------------
@ -132,29 +123,14 @@ void setup()
// Give flow of control to OS and scheduler
espmega.begin();
// // ------------ Factory Reset Routine ------------
// Disable factory reset for now
espmega.inputs.loop();
// Set time zone to UTC+7
espmega.setTimezone("ICT-7");
// set debounce time to 500 for pin 0-11
for (uint16_t i = 0; i < 12; i++)
{
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 ------------
Serial.print("boot_state.txt=\"IoT Initializing . . .\"");