aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@arduino.cc>2015-09-30 20:53:05 +0200
committerCristian Maglie <c.maglie@arduino.cc>2015-10-02 11:59:23 +0200
commit10512b3f9b2e30759d08af77960ab0ead539a055 (patch)
tree464d1ffe584a5d95fdf2434edb7b9144712e5b95
parentcabae13e55b8e6de88a3aee452a66a1e2a8c352b (diff)
[USB] Fixed some compiler warnings
-rw-r--r--cores/arduino/USBCore.h6
-rw-r--r--libraries/HID/HID.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/cores/arduino/USBCore.h b/cores/arduino/USBCore.h
index eaeecef..806fa60 100644
--- a/cores/arduino/USBCore.h
+++ b/cores/arduino/USBCore.h
@@ -99,8 +99,8 @@
// bEndpointAddress in Endpoint Descriptor
#define USB_ENDPOINT_DIRECTION_MASK 0x80
-#define USB_ENDPOINT_OUT(addr) ((addr) | 0x00)
-#define USB_ENDPOINT_IN(addr) ((addr) | 0x80)
+#define USB_ENDPOINT_OUT(addr) (lowByte((addr) | 0x00))
+#define USB_ENDPOINT_IN(addr) (lowByte((addr) | 0x80))
#define USB_ENDPOINT_TYPE_MASK 0x03
#define USB_ENDPOINT_TYPE_CONTROL 0x00
@@ -277,4 +277,4 @@ typedef struct
#define D_CDCCS4(_subtype,_d0) { 4, 0x24, _subtype, _d0 }
-#endif \ No newline at end of file
+#endif
diff --git a/libraries/HID/HID.h b/libraries/HID/HID.h
index 9e6e675..f951229 100644
--- a/libraries/HID/HID.h
+++ b/libraries/HID/HID.h
@@ -98,8 +98,7 @@ private:
uint8_t idle;
};
-#define D_HIDREPORT(_descriptorLength) \
- { 9, 0x21, 0x1, 0x1, 0, 1, 0x22, _descriptorLength & 0xFF, _descriptorLength >> 8 }
+#define D_HIDREPORT(length) { 9, 0x21, 0x01, 0x01, 0, 1, 0x22, lowByte(length), highByte(length) }
#define WEAK __attribute__ ((weak))