mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
esp32 uart
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user