Housekeeping

This commit is contained in:
Theo Arends 2019-01-18 10:52:18 +01:00
parent 4196197ed9
commit b5824fc361
2 changed files with 5 additions and 5 deletions

View File

@ -271,9 +271,7 @@ struct SYSCFG {
uint8_t ws_color[4][3]; // 475
uint8_t ws_width[3]; // 481
myio my_gp; // 484
byte free_495[1]; // 495
uint8_t test_step; // 495
uint16_t light_pixels; // 496
uint8_t light_color[5]; // 498
uint8_t light_correction; // 49D

View File

@ -2445,12 +2445,14 @@ void setup(void)
Settings.rule_enabled = 0; // Disable all rules
}
if (RtcReboot.fast_reboot_count > 4) { // Restarted 5 times
Settings.module = SONOFF_BASIC; // Reset module to Sonoff Basic
// Settings.last_module = SONOFF_BASIC;
for (byte i = 0; i < sizeof(Settings.my_gp); i++) {
Settings.my_gp.io[i] = GPIO_NONE; // Reset user defined GPIO disabling sensors
}
}
if (RtcReboot.fast_reboot_count > 5) { // Restarted 6 times
Settings.module = SONOFF_BASIC; // Reset module to Sonoff Basic
// Settings.last_module = SONOFF_BASIC;
}
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_APPLICATION D_LOG_SOME_SETTINGS_RESET " (%d)"), RtcReboot.fast_reboot_count);
AddLog(LOG_LEVEL_DEBUG);
}