Skip to content

Commit 55cf0e1

Browse files
committed
Switch 'available' return type to uint8_t
This function never returns an error (-1), and the number of bytes available will never be a negative number.
1 parent 971b3bb commit 55cf0e1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cores/arduino/xinput/USB_XInput_API.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ boolean XInputUSB::connected() {
3434
return USBDevice.configured();
3535
}
3636

37-
int XInputUSB::available() {
37+
uint8_t XInputUSB::available() {
3838
return USB_Available(XINPUT_RX_ENDPOINT);
3939
}
4040

cores/arduino/xinput/USB_XInput_API.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class XInputUSB {
3737
public:
3838
// API
3939
static bool connected(void);
40-
static int available(void);
41-
static int send(const void *buffer, uint8_t nbytes);
42-
static int recv(void *buffer, uint8_t nbytes);
40+
static uint8_t available(void);
41+
static int send(const void *buffer, uint8_t nbytes);
42+
static int recv(void *buffer, uint8_t nbytes);
4343
static void setRecvCallback(void(*callback)(void));
4444

4545
// Non-API Data

0 commit comments

Comments
 (0)