File tree 2 files changed +7
-1
lines changed
hardware/arduino/cores/arduino
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)
199
199
}
200
200
201
201
size_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)
202
207
{
203
208
/* only try to send bytes if the high-level CDC connection itself
204
209
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)
210
215
// open connection isn't broken cleanly (cable is yanked out, host dies
211
216
// or locks up, or host virtual serial port hangs)
212
217
if (_usbLineInfo.lineState > 0 ) {
213
- int r = USB_Send (CDC_TX,&c, 1 );
218
+ int r = USB_Send (CDC_TX,buffer,size );
214
219
if (r > 0 ) {
215
220
return r;
216
221
} else {
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ class Serial_ : public Stream
40
40
virtual int read (void );
41
41
virtual void flush (void );
42
42
virtual size_t write (uint8_t );
43
+ virtual size_t write (const uint8_t *, size_t );
43
44
using Print::write; // pull in write(str) and write(buf, size) from Print
44
45
operator bool ();
45
46
};
You can’t perform that action at this time.
0 commit comments