mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
fix uart bk7231n
This commit is contained in:
@@ -9,11 +9,11 @@ IoTUart::IoTUart(const String& parameters) : IoTItem(parameters) {
|
||||
jsonRead(parameters, "speed", _speed);
|
||||
jsonRead(parameters, "line", _line);
|
||||
|
||||
#ifdef ESP8266
|
||||
#if defined (ESP8266)
|
||||
_myUART = new SoftwareSerial(_rx, _tx);
|
||||
_myUART->begin(_speed);
|
||||
#endif
|
||||
#ifdef ESP32
|
||||
#if defined (ESP32)
|
||||
if (_line >= 0) {
|
||||
_myUART = new HardwareSerial(_line);
|
||||
((HardwareSerial*)_myUART)->begin(_speed, SERIAL_8N1, _rx, _tx);
|
||||
@@ -22,6 +22,10 @@ IoTUart::IoTUart(const String& parameters) : IoTItem(parameters) {
|
||||
((SoftwareSerial*)_myUART)->begin(_speed);
|
||||
}
|
||||
#endif
|
||||
#if defined (LIBRETINY)
|
||||
_myUART = new SerialClass(_rx, _tx);
|
||||
_myUART->begin((unsigned long)_speed);
|
||||
#endif
|
||||
}
|
||||
|
||||
void IoTUart::loop() {
|
||||
|
||||
Reference in New Issue
Block a user