aboutsummaryrefslogtreecommitdiff
path: root/cores
diff options
context:
space:
mode:
authorDavid Madison <dmadison@users.noreply.github.com>2019-03-09 15:52:15 -0500
committerDavid Madison <dmadison@users.noreply.github.com>2019-03-09 15:52:15 -0500
commit55cf0e1003a3a53b8f9948a4aa95275687b46ab4 (patch)
treec00c8ebca68ebfd0297248fa6a1ae97d39f0e797 /cores
parent971b3bb74113fc1bcd52122ba167849bded8ad99 (diff)
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.
Diffstat (limited to 'cores')
-rw-r--r--cores/arduino/xinput/USB_XInput_API.cpp2
-rw-r--r--cores/arduino/xinput/USB_XInput_API.h6
2 files changed, 4 insertions, 4 deletions
diff --git a/cores/arduino/xinput/USB_XInput_API.cpp b/cores/arduino/xinput/USB_XInput_API.cpp
index 678692d..ffd818c 100644
--- a/cores/arduino/xinput/USB_XInput_API.cpp
+++ b/cores/arduino/xinput/USB_XInput_API.cpp
@@ -34,7 +34,7 @@ boolean XInputUSB::connected() {
return USBDevice.configured();
}
-int XInputUSB::available() {
+uint8_t XInputUSB::available() {
return USB_Available(XINPUT_RX_ENDPOINT);
}
diff --git a/cores/arduino/xinput/USB_XInput_API.h b/cores/arduino/xinput/USB_XInput_API.h
index 9f2e686..11fa100 100644
--- a/cores/arduino/xinput/USB_XInput_API.h
+++ b/cores/arduino/xinput/USB_XInput_API.h
@@ -37,9 +37,9 @@ class XInputUSB {
public:
// API
static bool connected(void);
- static int available(void);
- static int send(const void *buffer, uint8_t nbytes);
- static int recv(void *buffer, uint8_t nbytes);
+ static uint8_t available(void);
+ static int send(const void *buffer, uint8_t nbytes);
+ static int recv(void *buffer, uint8_t nbytes);
static void setRecvCallback(void(*callback)(void));
// Non-API Data