Add support for the hardware CDC in ESP32-C3 (#5614)

* Add support for the hardware CDC in ESP32-C3
This commit is contained in:
Me No Dev
2021-08-31 08:47:55 +03:00
committed by GitHub
parent a62979d8a0
commit 4a55ff970d
7 changed files with 390 additions and 1 deletions

View File

@ -76,6 +76,8 @@ void serialEvent2(void) {}
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
#if ARDUINO_USB_CDC_ON_BOOT //Serial used for USB CDC
HardwareSerial Serial0(0);
#elif ARDUINO_HW_CDC_ON_BOOT
HardwareSerial Serial0(0);
#else
HardwareSerial Serial(0);
#endif
@ -91,6 +93,8 @@ void serialEventRun(void)
{
#if ARDUINO_USB_CDC_ON_BOOT //Serial used for USB CDC
if(Serial0.available()) serialEvent();
#elif ARDUINO_HW_CDC_ON_BOOT
if(Serial0.available()) serialEvent();
#else
if(Serial.available()) serialEvent();
#endif