File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,11 @@ void Serial_::flush(void)
199199}
200200
201201size_t Serial_::write (uint8_t c)
202+ {
203+ return write (&c, 1 );
204+ }
205+
206+ size_t Serial_::write (const uint8_t *buffer, size_t size)
202207{
203208 /* only try to send bytes if the high-level CDC connection itself
204209 is open (not just the pipe) - the OS should set lineState when the port
@@ -210,7 +215,7 @@ size_t Serial_::write(uint8_t c)
210215 // open connection isn't broken cleanly (cable is yanked out, host dies
211216 // or locks up, or host virtual serial port hangs)
212217 if (_usbLineInfo.lineState > 0 ) {
213- int r = USB_Send (CDC_TX,&c, 1 );
218+ int r = USB_Send (CDC_TX,buffer,size );
214219 if (r > 0 ) {
215220 return r;
216221 } else {
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ class Serial_ : public Stream
4040 virtual int read (void );
4141 virtual void flush (void );
4242 virtual size_t write (uint8_t );
43+ virtual size_t write (const uint8_t *, size_t );
4344 using Print::write; // pull in write(str) and write(buf, size) from Print
4445 operator bool ();
4546};
You can’t perform that action at this time.
0 commit comments