Fix ESP32 issues

This commit is contained in:
Theo Arends 2020-10-31 17:28:33 +01:00
parent 432051a7ef
commit 57a3e7f88c
3 changed files with 7 additions and 3 deletions

View File

@ -21,7 +21,7 @@ lib_ignore =
ESP32 Azure IoT Arduino ESP32 Azure IoT Arduino
ESP32 Async UDP ESP32 Async UDP
ESP32 BLE Arduino ESP32 BLE Arduino
SimpleBLE ; SimpleBLE
NetBIOS NetBIOS
ESP32 ESP32
Preferences Preferences

View File

@ -913,11 +913,11 @@ void SetSerialBegin(void) {
TasmotaGlobal.baudrate = Settings.baudrate * 300; TasmotaGlobal.baudrate = Settings.baudrate * 300;
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_SERIAL "Set to %s %d bit/s"), GetSerialConfig().c_str(), TasmotaGlobal.baudrate); AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_SERIAL "Set to %s %d bit/s"), GetSerialConfig().c_str(), TasmotaGlobal.baudrate);
Serial.flush(); Serial.flush();
Serial.end();
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
#ifdef ESP8266 #ifdef ESP8266
Serial.begin(TasmotaGlobal.baudrate, (SerialConfig)pgm_read_byte(kTasmotaSerialConfig + Settings.serial_config)); Serial.begin(TasmotaGlobal.baudrate, (SerialConfig)pgm_read_byte(kTasmotaSerialConfig + Settings.serial_config));
#else // ESP32 #else // ESP32
Serial.end();
delay(10); // Allow time to cleanup queues - if not used hangs ESP32
uint32_t config = pgm_read_dword(kTasmotaSerialConfig + Settings.serial_config); uint32_t config = pgm_read_dword(kTasmotaSerialConfig + Settings.serial_config);
Serial.begin(TasmotaGlobal.baudrate, config); Serial.begin(TasmotaGlobal.baudrate, config);
#endif #endif

View File

@ -875,7 +875,11 @@ const WebServerDispatch_t WebServerDispatch[] PROGMEM = {
}; };
void WebServer_on(const char * prefix, void (*func)(void), uint8_t method = HTTP_ANY) { void WebServer_on(const char * prefix, void (*func)(void), uint8_t method = HTTP_ANY) {
#ifdef ESP8266
Webserver->on((const __FlashStringHelper *) prefix, (HTTPMethod) method, func); Webserver->on((const __FlashStringHelper *) prefix, (HTTPMethod) method, func);
#else
Webserver->on(prefix, (HTTPMethod) method, func);
#endif
} }
void StartWebserver(int type, IPAddress ipweb) void StartWebserver(int type, IPAddress ipweb)