mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 03:36:42 +00:00
parent
5a73aa1e1f
commit
3220332b1c
@ -1885,15 +1885,14 @@ void SetSerialBegin(void) {
|
|||||||
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_SERIAL "Set to %s %d bit/s"), GetSerialConfig().c_str(), TasmotaGlobal.baudrate);
|
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_SERIAL "Set to %s %d bit/s"), GetSerialConfig().c_str(), TasmotaGlobal.baudrate);
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
Serial.begin(TasmotaGlobal.baudrate, (SerialConfig)pgm_read_byte(kTasmotaSerialConfig + Settings->serial_config));
|
Serial.begin(TasmotaGlobal.baudrate, (SerialConfig)ConvertSerialConfig(Settings->serial_config));
|
||||||
SetSerialSwap();
|
SetSerialSwap();
|
||||||
#endif // ESP8266
|
#endif // ESP8266
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
|
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
|
||||||
Serial.end();
|
Serial.end();
|
||||||
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
|
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
|
||||||
uint32_t config = pgm_read_dword(kTasmotaSerialConfig + Settings->serial_config);
|
Serial.begin(TasmotaGlobal.baudrate, ConvertSerialConfig(Settings->serial_config));
|
||||||
Serial.begin(TasmotaGlobal.baudrate, config);
|
|
||||||
#endif // ESP32
|
#endif // ESP32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,14 +46,7 @@ bool serial_bridge_raw = false;
|
|||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
|
|
||||||
bool SetSSerialBegin(void) {
|
bool SetSSerialBegin(void) {
|
||||||
uint32_t config;
|
return SerialBridgeSerial->begin(Settings->sbaudrate * 300, ConvertSerialConfig(Settings->sserial_config)); // Reinitialize serial port with new baud rate
|
||||||
#ifdef ESP8266
|
|
||||||
config = pgm_read_byte(kTasmotaSerialConfig + Settings->sserial_config);
|
|
||||||
#endif // ESP8266
|
|
||||||
#ifdef ESP32
|
|
||||||
config = pgm_read_dword(kTasmotaSerialConfig + Settings->sserial_config);
|
|
||||||
#endif // ESP32
|
|
||||||
return SerialBridgeSerial->begin(Settings->sbaudrate * 300, config); // Reinitialize serial port with new baud rate
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetSSerialConfig(uint32_t serial_config) {
|
void SetSSerialConfig(uint32_t serial_config) {
|
||||||
|
@ -3709,15 +3709,7 @@ extern char *SML_GetSVal(uint32_t index);
|
|||||||
glob_script_mem.sp = new TasmotaSerial(rxpin, txpin, 1, 0, rxbsiz);
|
glob_script_mem.sp = new TasmotaSerial(rxpin, txpin, 1, 0, rxbsiz);
|
||||||
|
|
||||||
if (glob_script_mem.sp) {
|
if (glob_script_mem.sp) {
|
||||||
uint32_t config;
|
fvar = glob_script_mem.sp->begin(br, ConvertSerialConfig(sconfig));
|
||||||
#ifdef ESP8266
|
|
||||||
config = pgm_read_byte(kTasmotaSerialConfig + sconfig);
|
|
||||||
#endif // ESP8266
|
|
||||||
|
|
||||||
#ifdef ESP32
|
|
||||||
config = pgm_read_dword(kTasmotaSerialConfig + sconfig);
|
|
||||||
#endif // ESP32
|
|
||||||
fvar = glob_script_mem.sp->begin(br, config);
|
|
||||||
uint32_t savc = Settings->serial_config;
|
uint32_t savc = Settings->serial_config;
|
||||||
//setRxBufferSize(TMSBSIZ);
|
//setRxBufferSize(TMSBSIZ);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user