Skip to content

Commit a31fdad

Browse files
committed
[USB] Fixed some compiler warnings
1 parent 8054bb6 commit a31fdad

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Diff for: hardware/arduino/avr/cores/arduino/USBCore.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999

100100
// bEndpointAddress in Endpoint Descriptor
101101
#define USB_ENDPOINT_DIRECTION_MASK 0x80
102-
#define USB_ENDPOINT_OUT(addr) ((addr) | 0x00)
103-
#define USB_ENDPOINT_IN(addr) ((addr) | 0x80)
102+
#define USB_ENDPOINT_OUT(addr) (lowByte((addr) | 0x00))
103+
#define USB_ENDPOINT_IN(addr) (lowByte((addr) | 0x80))
104104

105105
#define USB_ENDPOINT_TYPE_MASK 0x03
106106
#define USB_ENDPOINT_TYPE_CONTROL 0x00
@@ -277,4 +277,4 @@ typedef struct
277277
#define D_CDCCS4(_subtype,_d0) { 4, 0x24, _subtype, _d0 }
278278

279279

280-
#endif
280+
#endif

Diff for: hardware/arduino/avr/libraries/HID/HID.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ class HID_ : public PUSBListNode
9898
uint8_t idle;
9999
};
100100

101-
#define D_HIDREPORT(_descriptorLength) \
102-
{ 9, 0x21, 0x1, 0x1, 0, 1, 0x22, _descriptorLength & 0xFF, _descriptorLength >> 8 }
101+
#define D_HIDREPORT(length) { 9, 0x21, 0x01, 0x01, 0, 1, 0x22, lowByte(length), highByte(length) }
103102

104103
#define WEAK __attribute__ ((weak))
105104

0 commit comments

Comments
 (0)