mirror of https://github.com/arendst/Tasmota.git
Fix baudrate when module changed
Fix baudrate when module changed
This commit is contained in:
parent
49acf4a7d3
commit
28c1eed302
|
@ -2394,10 +2394,13 @@ void GpioInit()
|
||||||
uint8_t key_no_pullup = 0;
|
uint8_t key_no_pullup = 0;
|
||||||
mytmplt def_module;
|
mytmplt def_module;
|
||||||
|
|
||||||
if (!Settings.module || (Settings.module >= MAXMODULE)) {
|
if (Settings.module >= MAXMODULE) {
|
||||||
Settings.module = MODULE;
|
Settings.module = MODULE;
|
||||||
Settings.last_module = MODULE;
|
Settings.last_module = MODULE;
|
||||||
}
|
}
|
||||||
|
if (Settings.module != Settings.last_module) {
|
||||||
|
baudrate = APP_BAUDRATE;
|
||||||
|
}
|
||||||
|
|
||||||
memcpy_P(&def_module, &kModules[Settings.module], sizeof(def_module));
|
memcpy_P(&def_module, &kModules[Settings.module], sizeof(def_module));
|
||||||
strlcpy(my_module.name, def_module.name, sizeof(my_module.name));
|
strlcpy(my_module.name, def_module.name, sizeof(my_module.name));
|
||||||
|
@ -2646,7 +2649,7 @@ void setup()
|
||||||
}
|
}
|
||||||
if (RtcReboot.fast_reboot_count > 4) { // Restarted 5 times
|
if (RtcReboot.fast_reboot_count > 4) { // Restarted 5 times
|
||||||
Settings.module = SONOFF_BASIC; // Reset module to Sonoff Basic
|
Settings.module = SONOFF_BASIC; // Reset module to Sonoff Basic
|
||||||
Settings.last_module = SONOFF_BASIC;
|
// Settings.last_module = SONOFF_BASIC;
|
||||||
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
||||||
Settings.my_gp.io[i] = GPIO_NONE; // Reset user defined GPIO disabling sensors
|
Settings.my_gp.io[i] = GPIO_NONE; // Reset user defined GPIO disabling sensors
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue