Fix baudrate when module changed

Fix baudrate when module changed
This commit is contained in:
Theo Arends 2018-11-06 11:48:04 +01:00
parent 49acf4a7d3
commit 28c1eed302
1 changed files with 5 additions and 2 deletions

View File

@ -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