mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
change tx_mode without needing a restart
This commit is contained in:
@@ -700,6 +700,9 @@ void EMSESP::console_commands(Shell & shell, unsigned int context) {
|
|||||||
settings.ems_tx_mode(tx_mode);
|
settings.ems_tx_mode(tx_mode);
|
||||||
settings.commit();
|
settings.commit();
|
||||||
shell.printfln(F_(tx_mode_fmt), settings.ems_tx_mode());
|
shell.printfln(F_(tx_mode_fmt), settings.ems_tx_mode());
|
||||||
|
// reset the UART
|
||||||
|
EMSuart::stop();
|
||||||
|
EMSuart::start(tx_mode);
|
||||||
} else {
|
} else {
|
||||||
shell.println(F("Must be 1 for EMS generic, 2 for EMS+, 3 for HT3, 4 for experimental"));
|
shell.println(F("Must be 1 for EMS generic, 2 for EMS+, 3 for HT3, 4 for experimental"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ uuid::log::Logger System::logger_{F_(logger_name), uuid::log::Facility::KERN};
|
|||||||
uuid::syslog::SyslogService System::syslog_;
|
uuid::syslog::SyslogService System::syslog_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
EMSuart System::emsuart_;
|
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
RTCVars System::state_;
|
RTCVars System::state_;
|
||||||
#endif
|
#endif
|
||||||
@@ -170,7 +168,7 @@ void System::start() {
|
|||||||
if (safe_mode()) {
|
if (safe_mode()) {
|
||||||
} else {
|
} else {
|
||||||
save_safe_mode(false); // next time boot up in normal mode
|
save_safe_mode(false); // next time boot up in normal mode
|
||||||
emsuart_.start(settings.ems_tx_mode());
|
EMSuart::start(settings.ems_tx_mode());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,8 +105,6 @@ class System {
|
|||||||
static uint32_t heap_start_;
|
static uint32_t heap_start_;
|
||||||
static int reset_counter_;
|
static int reset_counter_;
|
||||||
|
|
||||||
static EMSuart emsuart_;
|
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
static RTCVars state_;
|
static RTCVars state_;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user