projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0284385
)
Update LUFA core to be compatible with the AVR-GCC -Wswitch-default warning switch.
author
Dean Camera
<dean@fourwalledcubicle.com>
Sun, 9 Sep 2012 14:00:03 +0000
(14:00 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Sun, 9 Sep 2012 14:00:03 +0000
(14:00 +0000)
BuildTests/ModuleTest/makefile.test
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Class/Common/HIDParser.c
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Core/DeviceStandardReq.c
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Core/UC3/Host_UC3.c
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h
patch
|
blob
|
blame
|
history
LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h
patch
|
blob
|
blame
|
history
LUFA/Platform/XMEGA/ClockManagement.h
patch
|
blob
|
blame
|
history
diff --git
a/BuildTests/ModuleTest/makefile.test
b/BuildTests/ModuleTest/makefile.test
index
c87aeda
..
1ea9173
100644
(file)
--- a/
BuildTests/ModuleTest/makefile.test
+++ b/
BuildTests/ModuleTest/makefile.test
@@
-45,6
+45,7
@@
CC_FLAGS += -Wmissing-declarations
CC_FLAGS += -Wmissing-field-initializers
CC_FLAGS += -Wmissing-format-attribute
CC_FLAGS += -Woverlength-strings
CC_FLAGS += -Wmissing-field-initializers
CC_FLAGS += -Wmissing-format-attribute
CC_FLAGS += -Woverlength-strings
+CC_FLAGS += -Wswitch-default
# Only enable rendundant declaration warnings for AVR8 target (FIXME)
ifeq ($(ARCH), AVR8)
# Only enable rendundant declaration warnings for AVR8 target (FIXME)
ifeq ($(ARCH), AVR8)
@@
-56,7
+57,6
@@
C_FLAGS += -Wmissing-parameter-type
C_FLAGS += -Wnested-externs
# Potential additional warnings to enable in the future (FIXME)
C_FLAGS += -Wnested-externs
# Potential additional warnings to enable in the future (FIXME)
-#CC_FLAGS += -Wswitch-default
#CC_FLAGS += -Wc++-compat
#CC_FLAGS += -Wcast-qual
#CC_FLAGS += -Wconversion
#CC_FLAGS += -Wc++-compat
#CC_FLAGS += -Wcast-qual
#CC_FLAGS += -Wconversion
diff --git
a/LUFA/Drivers/USB/Class/Common/HIDParser.c
b/LUFA/Drivers/USB/Class/Common/HIDParser.c
index
4447e8a
..
4b4667b
100644
(file)
--- a/
LUFA/Drivers/USB/Class/Common/HIDParser.c
+++ b/
LUFA/Drivers/USB/Class/Common/HIDParser.c
@@
-53,7
+53,7
@@
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
while (ReportSize)
{
uint8_t HIDReportItem = *ReportData;
while (ReportSize)
{
uint8_t HIDReportItem = *ReportData;
- uint32_t ReportItemData
= 0
;
+ uint32_t ReportItemData;
ReportData++;
ReportSize--;
ReportData++;
ReportSize--;
@@
-66,16
+66,22
@@
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
ReportSize -= 4;
ReportData += 4;
break;
ReportSize -= 4;
ReportData += 4;
break;
+
case HID_RI_DATA_BITS_16:
ReportItemData = (((uint16_t)ReportData[1] << 8) | (ReportData[0]));
ReportSize -= 2;
ReportData += 2;
break;
case HID_RI_DATA_BITS_16:
ReportItemData = (((uint16_t)ReportData[1] << 8) | (ReportData[0]));
ReportSize -= 2;
ReportData += 2;
break;
+
case HID_RI_DATA_BITS_8:
ReportItemData = ReportData[0];
ReportSize -= 1;
ReportData += 1;
break;
case HID_RI_DATA_BITS_8:
ReportItemData = ReportData[0];
ReportSize -= 1;
ReportData += 1;
break;
+
+ default:
+ ReportItemData = 0;
+ break;
}
switch (HIDReportItem & (HID_RI_TYPE_MASK | HID_RI_TAG_MASK))
}
switch (HIDReportItem & (HID_RI_TYPE_MASK | HID_RI_TAG_MASK))
@@
-269,6
+275,9
@@
uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
}
break;
}
break;
+
+ default:
+ break;
}
if ((HIDReportItem & HID_RI_TYPE_MASK) == HID_RI_TYPE_MAIN)
}
if ((HIDReportItem & HID_RI_TYPE_MASK) == HID_RI_TYPE_MAIN)
diff --git
a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
index
a1e0fd3
..
37486f1
100644
(file)
--- a/
LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
+++ b/
LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
@@
-180,6
+180,9
@@
void USB_Host_ProcessNextHostState(void)
EVENT_USB_Host_DeviceEnumerationComplete();
break;
EVENT_USB_Host_DeviceEnumerationComplete();
break;
+
+ default:
+ break;
}
if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))
}
if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))
diff --git
a/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h
b/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h
index
a702247
..
cea8628
100644
(file)
--- a/
LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h
+++ b/
LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h
@@
-139,6
+139,8
@@
OTGIEN |= (1 << SRPE);
break;
#endif
OTGIEN |= (1 << SRPE);
break;
#endif
+ default:
+ break;
}
}
}
}
@@
-197,6
+199,8
@@
OTGIEN &= ~(1 << SRPE);
break;
#endif
OTGIEN &= ~(1 << SRPE);
break;
#endif
+ default:
+ break;
}
}
}
}
@@
-255,6
+259,8
@@
OTGINT &= ~(1 << SRPI);
break;
#endif
OTGINT &= ~(1 << SRPI);
break;
#endif
+ default:
+ break;
}
}
}
}
@@
-299,9
+305,9
@@
case USB_INT_SRPI:
return (OTGIEN & (1 << SRPE));
#endif
case USB_INT_SRPI:
return (OTGIEN & (1 << SRPE));
#endif
+ default:
+ return false;
}
}
-
- return false;
}
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
}
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
@@
-345,9
+351,9
@@
case USB_INT_SRPI:
return (OTGINT & (1 << SRPI));
#endif
case USB_INT_SRPI:
return (OTGINT & (1 << SRPI));
#endif
+ default:
+ return false;
}
}
-
- return false;
}
/* Includes: */
}
/* Includes: */
diff --git
a/LUFA/Drivers/USB/Core/DeviceStandardReq.c
b/LUFA/Drivers/USB/Core/DeviceStandardReq.c
index
f5e1cca
..
c2c9e7d
100644
(file)
--- a/
LUFA/Drivers/USB/Core/DeviceStandardReq.c
+++ b/
LUFA/Drivers/USB/Core/DeviceStandardReq.c
@@
-109,6
+109,9
@@
void USB_Device_ProcessControlRequest(void)
USB_Device_SetConfiguration();
break;
USB_Device_SetConfiguration();
break;
+
+ default:
+ break;
}
}
}
}
diff --git
a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c
index
932381a
..
172239c
100644
(file)
--- a/
LUFA/Drivers/USB/Core/UC3/Host_UC3.c
+++ b/
LUFA/Drivers/USB/Core/UC3/Host_UC3.c
@@
-180,6
+180,9
@@
void USB_Host_ProcessNextHostState(void)
EVENT_USB_Host_DeviceEnumerationComplete();
break;
EVENT_USB_Host_DeviceEnumerationComplete();
break;
+
+ default:
+ break;
}
if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))
}
if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))
diff --git
a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h
b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h
index
871a0ca
..
bcefa36
100644
(file)
--- a/
LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h
+++ b/
LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h
@@
-134,6
+134,8
@@
AVR32_USBB.USBCON.vberre = true;
break;
#endif
AVR32_USBB.USBCON.vberre = true;
break;
#endif
+ default:
+ break;
}
}
}
}
@@
-187,6
+189,8
@@
AVR32_USBB.USBCON.vberre = false;
break;
#endif
AVR32_USBB.USBCON.vberre = false;
break;
#endif
+ default:
+ break;
}
}
}
}
@@
-252,6
+256,8
@@
(void)AVR32_USBB.USBSTACLR;
break;
#endif
(void)AVR32_USBB.USBSTACLR;
break;
#endif
+ default:
+ break;
}
}
}
}
@@
-292,9
+298,9
@@
case USB_INT_VBERRI:
return AVR32_USBB.USBCON.vberre;
#endif
case USB_INT_VBERRI:
return AVR32_USBB.USBCON.vberre;
#endif
+ default:
+ return false;
}
}
-
- return false;
}
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
}
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
@@
-334,9
+340,9
@@
case USB_INT_VBERRI:
return AVR32_USBB.USBSTA.vberri;
#endif
case USB_INT_VBERRI:
return AVR32_USBB.USBSTA.vberri;
#endif
+ default:
+ return false;
}
}
-
- return false;
}
/* Includes: */
}
/* Includes: */
diff --git
a/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h
b/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h
index
6a07626
..
e917c8e
100644
(file)
--- a/
LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h
+++ b/
LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h
@@
-74,10
+74,12
@@
{
case USB_INT_BUSEVENTI:
USB.INTCTRLA |= USB_BUSEVIE_bm;
{
case USB_INT_BUSEVENTI:
USB.INTCTRLA |= USB_BUSEVIE_bm;
-
return
;
+
break
;
case USB_INT_SOFI:
USB.INTCTRLA |= USB_SOFIE_bm;
case USB_INT_SOFI:
USB.INTCTRLA |= USB_SOFIE_bm;
- return;
+ break;
+ default:
+ break;
}
}
}
}
@@
-88,10
+90,12
@@
{
case USB_INT_BUSEVENTI:
USB.INTCTRLA &= ~USB_BUSEVIE_bm;
{
case USB_INT_BUSEVENTI:
USB.INTCTRLA &= ~USB_BUSEVIE_bm;
-
return
;
+
break
;
case USB_INT_SOFI:
USB.INTCTRLA &= ~USB_SOFIE_bm;
case USB_INT_SOFI:
USB.INTCTRLA &= ~USB_SOFIE_bm;
- return;
+ break;
+ default:
+ break;
}
}
}
}
@@
-102,16
+106,18
@@
{
case USB_INT_BUSEVENTI_Suspend:
USB.INTFLAGSACLR = USB_SUSPENDIF_bm;
{
case USB_INT_BUSEVENTI_Suspend:
USB.INTFLAGSACLR = USB_SUSPENDIF_bm;
-
return
;
+
break
;
case USB_INT_BUSEVENTI_Resume:
USB.INTFLAGSACLR = USB_RESUMEIF_bm;
case USB_INT_BUSEVENTI_Resume:
USB.INTFLAGSACLR = USB_RESUMEIF_bm;
-
return
;
+
break
;
case USB_INT_BUSEVENTI_Reset:
USB.INTFLAGSACLR = USB_RSTIF_bm;
case USB_INT_BUSEVENTI_Reset:
USB.INTFLAGSACLR = USB_RSTIF_bm;
-
return
;
+
break
;
case USB_INT_SOFI:
USB.INTFLAGSACLR = USB_SOFIF_bm;
case USB_INT_SOFI:
USB.INTFLAGSACLR = USB_SOFIF_bm;
- return;
+ break;
+ default:
+ break;
}
}
}
}
@@
-124,9
+130,9
@@
return ((USB.INTCTRLA & USB_BUSEVIE_bm) ? true : false);
case USB_INT_SOFI:
return ((USB.INTCTRLA & USB_SOFIE_bm) ? true : false);
return ((USB.INTCTRLA & USB_BUSEVIE_bm) ? true : false);
case USB_INT_SOFI:
return ((USB.INTCTRLA & USB_SOFIE_bm) ? true : false);
+ default:
+ return false;
}
}
-
- return false;
}
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
}
static inline bool USB_INT_HasOccurred(const uint8_t Interrupt) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
@@
-142,9
+148,9
@@
return ((USB.INTFLAGSACLR & USB_RSTIF_bm) ? true : false);
case USB_INT_SOFI:
return ((USB.INTFLAGSACLR & USB_SOFIF_bm) ? true : false);
return ((USB.INTFLAGSACLR & USB_RSTIF_bm) ? true : false);
case USB_INT_SOFI:
return ((USB.INTFLAGSACLR & USB_SOFIF_bm) ? true : false);
+ default:
+ return false;
}
}
-
- return false;
}
/* Includes: */
}
/* Includes: */
diff --git
a/LUFA/Platform/XMEGA/ClockManagement.h
b/LUFA/Platform/XMEGA/ClockManagement.h
index
c824c89
..
971068f
100644
(file)
--- a/
LUFA/Platform/XMEGA/ClockManagement.h
+++ b/
LUFA/Platform/XMEGA/ClockManagement.h
@@
-188,9
+188,9
@@
OSC.CTRL |= OSC_RC32KEN_bm;
while (!(OSC.STATUS & OSC_RC32KRDY_bm));
return true;
OSC.CTRL |= OSC_RC32KEN_bm;
while (!(OSC.STATUS & OSC_RC32KRDY_bm));
return true;
+ default:
+ return false;
}
}
-
- return false;
}
/** Stops the given internal oscillator of the XMEGA microcontroller.
}
/** Stops the given internal oscillator of the XMEGA microcontroller.
@@
-213,9
+213,9
@@
case CLOCK_SRC_INT_RC32KHZ:
OSC.CTRL &= ~OSC_RC32KEN_bm;
return true;
case CLOCK_SRC_INT_RC32KHZ:
OSC.CTRL &= ~OSC_RC32KEN_bm;
return true;
+ default:
+ return false;
}
}
-
- return false;
}
/** Starts the PLL of the XMEGA microcontroller, with the given options. This routine blocks until the PLL is ready for use.
}
/** Starts the PLL of the XMEGA microcontroller, with the given options. This routine blocks until the PLL is ready for use.