Skip to content

Commit 8f2dc69

Browse files
cmagliefacchinm
authored andcommitted
USBDevice: fixed some minor warnings
1 parent f72479d commit 8f2dc69

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

cores/arduino/USB/CDC.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ static volatile int32_t breakValue = -1;
5858
_Pragma("pack()")
5959

6060
// CDC
61-
#define CDC_ACM_INTERFACE pluggedInterface // CDC ACM
62-
#define CDC_DATA_INTERFACE pluggedInterface+1 // CDC Data
63-
#define CDC_ENDPOINT_ACM pluggedEndpoint
64-
#define CDC_ENDPOINT_OUT pluggedEndpoint+1
65-
#define CDC_ENDPOINT_IN pluggedEndpoint+2
61+
#define CDC_ACM_INTERFACE pluggedInterface // CDC ACM
62+
#define CDC_DATA_INTERFACE uint8_t(pluggedInterface + 1) // CDC Data
63+
#define CDC_ENDPOINT_ACM pluggedEndpoint
64+
#define CDC_ENDPOINT_OUT pluggedEndpoint + 1
65+
#define CDC_ENDPOINT_IN pluggedEndpoint + 2
6666

6767
#define CDC_RX CDC_ENDPOINT_OUT
6868
#define CDC_TX CDC_ENDPOINT_IN
@@ -91,7 +91,7 @@ int Serial_::getInterface(uint8_t* interfaceNum)
9191
return USBDevice.sendControl(&_cdcInterface, sizeof(_cdcInterface));
9292
}
9393

94-
int Serial_::getDescriptor(USBSetup& setup)
94+
int Serial_::getDescriptor(USBSetup& /* setup */)
9595
{
9696
return 0;
9797
}

cores/arduino/USB/PluggableUSB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PluggableUSBModule {
3535
virtual bool setup(USBSetup& setup) = 0;
3636
virtual int getInterface(uint8_t* interfaceCount) = 0;
3737
virtual int getDescriptor(USBSetup& setup) = 0;
38-
virtual void handleEndpoint(int ep) {/* Do nothing */}
38+
virtual void handleEndpoint(int /* ep */) { /* Do nothing */ }
3939
virtual uint8_t getShortName(char *name) { name[0] = 'A'+pluggedInterface; return 1; }
4040

4141
uint8_t pluggedInterface;

cores/arduino/USB/USBCore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
// bEndpointAddress in Endpoint Descriptor
3535
#define USB_ENDPOINT_DIRECTION_MASK 0x80
36-
#define USB_ENDPOINT_OUT(addr) ((addr) | 0x00)
37-
#define USB_ENDPOINT_IN(addr) ((addr) | 0x80)
36+
#define USB_ENDPOINT_OUT(addr) uint8_t((addr) | 0x00)
37+
#define USB_ENDPOINT_IN(addr) uint8_t((addr) | 0x80)
3838

3939
#define USB_ENDPOINTS 7
4040

0 commit comments

Comments
 (0)