Skip to content

Commit 34bf542

Browse files
committed
USB: set return type of USBDevice::recv(ep) to int
this is the proper type to encapsulate a byte when data is available or -1 when there is no data.
1 parent 40d9554 commit 34bf542

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/arduino/USB/USBAPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class USBDeviceClass {
8888
uint32_t send(uint32_t ep, const void *data, uint32_t len);
8989
void sendZlp(uint32_t ep);
9090
uint32_t recv(uint32_t ep, void *data, uint32_t len);
91-
uint32_t recv(uint32_t ep);
91+
int recv(uint32_t ep);
9292
uint32_t available(uint32_t ep);
9393
void flush(uint32_t ep);
9494
void stall(uint32_t ep);

cores/arduino/USB/USBCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ uint32_t USBDeviceClass::recv(uint32_t ep, void *_data, uint32_t len)
572572
}
573573

574574
// Recv 1 byte if ready
575-
uint32_t USBDeviceClass::recv(uint32_t ep)
575+
int USBDeviceClass::recv(uint32_t ep)
576576
{
577577
uint8_t c;
578578
if (recv(ep, &c, 1) != 1) {

0 commit comments

Comments
 (0)