mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
force serial off
This commit is contained in:
@@ -45,7 +45,6 @@ MyESP::MyESP() {
|
||||
_web_callback = NULL;
|
||||
|
||||
_serial = false;
|
||||
_serial_default = false;
|
||||
|
||||
_heartbeat = false;
|
||||
_mqtt_host = NULL;
|
||||
@@ -560,13 +559,6 @@ void MyESP::_telnet_setup() {
|
||||
SerialAndTelnet.setDebugOutput(false);
|
||||
SerialAndTelnet.begin(TELNET_SERIAL_BAUD); // default baud is 115200
|
||||
|
||||
// serial is only on when booting
|
||||
#ifdef DEFAULT_NO_SERIAL
|
||||
_serial_default = false;
|
||||
#else
|
||||
_serial_default = true;
|
||||
#endif
|
||||
|
||||
// init command buffer for console commands
|
||||
memset(_command, 0, TELNET_MAX_COMMAND_LENGTH);
|
||||
}
|
||||
@@ -790,7 +782,7 @@ bool MyESP::_changeSetting(uint8_t wc, const char * setting, const char * value)
|
||||
|
||||
// force the serial on/off
|
||||
void MyESP::setUseSerial(bool b) {
|
||||
_serial_default = _serial = b;
|
||||
_serial = b;
|
||||
SerialAndTelnet.setSerial(b ? &Serial : NULL);
|
||||
}
|
||||
|
||||
@@ -1549,10 +1541,14 @@ bool MyESP::_fs_loadConfig() {
|
||||
value = json["mqtt_password"];
|
||||
_mqtt_password = (value) ? strdup(value) : NULL;
|
||||
|
||||
_serial = json["serial"] | _serial_default;
|
||||
|
||||
_heartbeat = (bool)json["heartbeat"]; // defaults to off
|
||||
|
||||
// serial is only on when booting
|
||||
#ifdef FORCE_SERIAL
|
||||
_serial_ = true;
|
||||
#else
|
||||
_serial = json["serial"];
|
||||
#endif
|
||||
|
||||
// callback for loading custom settings
|
||||
// ok is false if there's a problem loading a custom setting (e.g. does not exist)
|
||||
|
||||
@@ -379,7 +379,6 @@ class MyESP {
|
||||
char * _boottime;
|
||||
bool _suspendOutput;
|
||||
bool _serial;
|
||||
bool _serial_default;
|
||||
bool _heartbeat;
|
||||
unsigned long _getUptime();
|
||||
String _buildTime();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
default_envs = debug
|
||||
|
||||
[common]
|
||||
; -DMYESP_TIMESTAMP -DTESTS -DCRASH -DNO_SERIAL -DNO_GLOBAL_EEPROM -DLOGICANALYZER
|
||||
; -DMYESP_TIMESTAMP -DTESTS -DCRASH -DFORCE_SERIAL -DNO_GLOBAL_EEPROM -DLOGICANALYZER
|
||||
extra_flags = -DNO_GLOBAL_EEPROM
|
||||
|
||||
[env]
|
||||
|
||||
@@ -2747,6 +2747,6 @@ void ems_testTelegram(uint8_t test_num) {
|
||||
// go an parse it
|
||||
ems_parseTelegram(telegram, length + 1); // include CRC in length
|
||||
#else
|
||||
myDebug_P(PSTR("Firmware not compiled with test data set"));
|
||||
myDebug_P(PSTR("Firmware not compiled with test data. Use -DTESTS"));
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user