File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ class SerialUSB_ : public ZephyrSerial {
1818 void begin (unsigned long baudrate) { begin (baudrate, SERIAL_8N1); }
1919
2020 operator bool () override ;
21+ size_t write (const uint8_t *buffer, size_t size) override ;
22+ void flush () override ;
2123
2224protected:
2325 uint32_t dtr = 0 ;
Original file line number Diff line number Diff line change @@ -124,5 +124,16 @@ arduino::SerialUSB_::operator bool() {
124124 return dtr;
125125}
126126
127+
128+ size_t arduino::SerialUSB_::write (const uint8_t *buffer, size_t size) {
129+ if (!Serial) return 0 ;
130+ return arduino::ZephyrSerial::write (buffer, size);
131+ }
132+
133+ void arduino::SerialUSB_::flush () {
134+ if (!Serial) return ;
135+ arduino::ZephyrSerial::flush ();
136+ }
137+
127138arduino::SerialUSB_ Serial (usb_dev);
128139#endif
You can’t perform that action at this time.
0 commit comments