Update LUFA core to be compatible with the AVR-GCC -Wswitch-default warning switch.

pull/1469/head
Dean Camera 12 years ago
parent 0284385b4e
commit 7a51e97c3b

@ -45,6 +45,7 @@ CC_FLAGS += -Wmissing-declarations
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)
@ -56,7 +57,6 @@ C_FLAGS += -Wmissing-parameter-type
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

@ -53,7 +53,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
while (ReportSize)
{
uint8_t HIDReportItem = *ReportData;
uint32_t ReportItemData = 0;
uint32_t ReportItemData;
ReportData++;
ReportSize--;
@ -66,16 +66,22 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
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_8:
ReportItemData = ReportData[0];
ReportSize -= 1;
ReportData += 1;
break;
default:
ReportItemData = 0;
break;
}
switch (HIDReportItem & (HID_RI_TYPE_MASK | HID_RI_TAG_MASK))
@ -269,6 +275,9 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
}
break;
default:
break;
}
if ((HIDReportItem & HID_RI_TYPE_MASK) == HID_RI_TYPE_MAIN)

@ -180,6 +180,9 @@ void USB_Host_ProcessNextHostState(void)
EVENT_USB_Host_DeviceEnumerationComplete();
break;
default:
break;
}
if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))

@ -139,6 +139,8 @@
OTGIEN |= (1 << SRPE);
break;
#endif
default:
break;
}
}
@ -197,6 +199,8 @@
OTGIEN &= ~(1 << SRPE);
break;
#endif
default:
break;
}
}
@ -255,6 +259,8 @@
OTGINT &= ~(1 << SRPI);
break;
#endif
default:
break;
}
}
@ -299,9 +305,9 @@
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;
@ -345,9 +351,9 @@
case USB_INT_SRPI:
return (OTGINT & (1 << SRPI));
#endif
default:
return false;
}
return false;
}
/* Includes: */

@ -109,6 +109,9 @@ void USB_Device_ProcessControlRequest(void)
USB_Device_SetConfiguration();
break;
default:
break;
}
}

@ -180,6 +180,9 @@ void USB_Host_ProcessNextHostState(void)
EVENT_USB_Host_DeviceEnumerationComplete();
break;
default:
break;
}
if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))

@ -134,6 +134,8 @@
AVR32_USBB.USBCON.vberre = true;
break;
#endif
default:
break;
}
}
@ -187,6 +189,8 @@
AVR32_USBB.USBCON.vberre = false;
break;
#endif
default:
break;
}
}
@ -252,6 +256,8 @@
(void)AVR32_USBB.USBSTACLR;
break;
#endif
default:
break;
}
}
@ -292,9 +298,9 @@
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;
@ -334,9 +340,9 @@
case USB_INT_VBERRI:
return AVR32_USBB.USBSTA.vberri;
#endif
default:
return false;
}
return false;
}
/* Includes: */

@ -74,10 +74,12 @@
{
case USB_INT_BUSEVENTI:
USB.INTCTRLA |= USB_BUSEVIE_bm;
return;
break;
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;
return;
break;
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;
return;
break;
case USB_INT_BUSEVENTI_Resume:
USB.INTFLAGSACLR = USB_RESUMEIF_bm;
return;
break;
case USB_INT_BUSEVENTI_Reset:
USB.INTFLAGSACLR = USB_RSTIF_bm;
return;
break;
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);
default:
return false;
}
return false;
}
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);
default:
return false;
}
return false;
}
/* Includes: */

@ -188,9 +188,9 @@
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.
@ -213,9 +213,9 @@
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.

Loading…
Cancel
Save