Refactor serial class with templates (#20783)
This commit is contained in:
@@ -24,14 +24,13 @@
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
#include <HardwareSerial.h>
|
||||
#include "../../core/serial_hook.h"
|
||||
|
||||
class FlushableHardwareSerial : public HardwareSerial {
|
||||
public:
|
||||
FlushableHardwareSerial(int uart_nr);
|
||||
|
||||
inline void flushTX() { /* No need to flush the hardware serial, but defined here for compatibility. */ }
|
||||
FlushableHardwareSerial(int uart_nr) : HardwareSerial(uart_nr) {}
|
||||
};
|
||||
|
||||
extern FlushableHardwareSerial flushableSerial;
|
||||
extern Serial0Type<FlushableHardwareSerial> flushableSerial;
|
||||
|
||||
#endif // ARDUINO_ARCH_ESP32
|
||||
|
||||
Reference in New Issue
Block a user