Skip to content

Commit b7e543b

Browse files
qqqlabfpistm
authored andcommitted
Add readBytes(uint8_t *buffer, size_t length) to USBSerial.h
Signed-off-by: qqqlab <[email protected]>
1 parent 93d9973 commit b7e543b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libraries/USBDevice/inc/USBSerial.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,15 @@ class USBSerial : public Stream {
3737
virtual int peek(void);
3838
virtual int read(void);
3939
virtual size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer
40+
size_t readBytes(uint8_t *buffer, size_t length)
41+
{
42+
return readBytes((char *)buffer, length);
43+
}
4044
virtual size_t readBytesUntil(char terminator, char *buffer, size_t length); // as readBytes with terminator character
45+
size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length)
46+
{
47+
return readBytesUntil(terminator, (char *)buffer, length);
48+
}
4149
virtual void flush(void);
4250
virtual size_t write(uint8_t);
4351
virtual size_t write(const uint8_t *buffer, size_t size);

0 commit comments

Comments
 (0)