esp32 uart

This commit is contained in:
Dmitry Borisenko
2020-12-06 00:40:48 +03:00
parent d15cf619f1
commit 4436991205

View File

@@ -1,10 +1,20 @@
#include "SoftUART.h"
SoftwareSerial* myUART{ nullptr };
#ifdef ESP8266
SoftwareSerial* myUART = nullptr;
#else
HardwareSerial* myUART = nullptr;
#endif
void uartInit() {
if (!myUART) {
#ifdef ESP8266
myUART = new SoftwareSerial(4, 5);
myUART->begin(9600);
#else
myUART = new HardwareSerial(2);
myUART->begin(4, 5);
#endif
}
}
@@ -23,5 +33,5 @@ void uartHandle() {
void parse(String& incStr) {
}