diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-09-09 14:00:03 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-09-09 14:00:03 +0000 |
commit | 7a51e97c3b8d8b1af193cb54c77d12ecba03f898 (patch) | |
tree | 95fbdf9ca11bba627d09b9429b5e00ab7dd8a1fb /LUFA | |
parent | 0284385b4e1c9a629e5c5b89ecc701a3d9bd5001 (diff) | |
download | lufa-7a51e97c3b8d8b1af193cb54c77d12ecba03f898.tar.gz lufa-7a51e97c3b8d8b1af193cb54c77d12ecba03f898.tar.bz2 lufa-7a51e97c3b8d8b1af193cb54c77d12ecba03f898.zip |
Update LUFA core to be compatible with the AVR-GCC -Wswitch-default warning switch.
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Drivers/USB/Class/Common/HIDParser.c | 11 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.h | 14 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/DeviceStandardReq.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/UC3/Host_UC3.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h | 14 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h | 30 | ||||
-rw-r--r-- | LUFA/Platform/XMEGA/ClockManagement.h | 8 |
8 files changed, 61 insertions, 25 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.c b/LUFA/Drivers/USB/Class/Common/HIDParser.c index 4447e8a0b..4b4667b4f 100644 --- 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; - 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) diff --git a/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c b/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c index a1e0fd371..37486f198 100644 --- 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; + + default: + break; } 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 a70224727..cea8628f1 100644 --- 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 + 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: */ diff --git a/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/LUFA/Drivers/USB/Core/DeviceStandardReq.c index f5e1cca33..c2c9e7d5a 100644 --- 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; + + default: + break; } } diff --git a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c index 932381a14..172239c46 100644 --- 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; + + default: + break; } 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 871a0cac2..bcefa361f 100644 --- 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 + 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: */ diff --git a/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h b/LUFA/Drivers/USB/Core/XMEGA/USBInterrupt_XMEGA.h index 6a07626a5..e917c8e07 100644 --- 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; - 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: */ diff --git a/LUFA/Platform/XMEGA/ClockManagement.h b/LUFA/Platform/XMEGA/ClockManagement.h index c824c89fb..971068fdd 100644 --- 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; + 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. |