Skip to content

Commit 0a45844

Browse files
authored
Update HardwareSerial.h
1 parent d1a781d commit 0a45844

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cores/esp32/HardwareSerial.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ class HardwareSerial: public Stream
107107
void setDebugOutput(bool);
108108

109109
void setRxInvert(bool);
110-
void setPins(uint8_t rxPin, uint8_t txPin);
110+
111+
// Negative Pin Number will keep it unmodified, thus this function can set individual pins
112+
// SetPins shall be called after Serial begin()
113+
void setPins(int8_t rxPin, int8_t txPin, int8_t ctsPin = -1, int8_t rtsPin = -1);
114+
// Enables or disables Hardware Flow Control using RTS and/or CTS pins (must use setAllPins() before)
115+
void setHwFlowCtrlMode(uint8_t mode = HW_FLOWCTRL_CTS_RTS, uint8_t threshold = 64); // 64 is half FIFO Length
116+
111117
size_t setRxBufferSize(size_t new_size);
112118

113119
protected:
@@ -123,10 +129,10 @@ extern void serialEventRun(void) __attribute__((weak));
123129
#define ARDUINO_USB_CDC_ON_BOOT 0
124130
#endif
125131
#if ARDUINO_USB_CDC_ON_BOOT //Serial used for USB CDC
126-
#if !ARDUINO_USB_MODE
127132
#include "USB.h"
128133
#include "USBCDC.h"
129-
#endif
134+
extern HardwareSerial Serial0;
135+
#elif ARDUINO_HW_CDC_ON_BOOT
130136
extern HardwareSerial Serial0;
131137
#else
132138
extern HardwareSerial Serial;

0 commit comments

Comments
 (0)