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
32
src/main.cpp
32
src/main.cpp
|
|
@ -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 . . .\"");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue