Fixed incorrect signature reported in the CDC class bootloader for the ATMEGA32U2.
[pub/USBasp.git] / Demos / Device / ClassDriver / KeyboardMouse / KeyboardMouse.c
index b032f87..6ba7ce3 100644 (file)
@@ -130,15 +130,14 @@ void EVENT_USB_Device_Disconnect(void)
 /** Event handler for the library USB Configuration Changed event. */
 void EVENT_USB_Device_ConfigurationChanged(void)
 {
 /** Event handler for the library USB Configuration Changed event. */
 void EVENT_USB_Device_ConfigurationChanged(void)
 {
-       LEDs_SetAllLEDs(LEDMASK_USB_READY);
+       bool ConfigSuccess = true;
 
 
-       if (!(HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface)))
-         LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
-       
-       if (!(HID_Device_ConfigureEndpoints(&Mouse_HID_Interface)))
-         LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
+       ConfigSuccess &= HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface);
+       ConfigSuccess &= HID_Device_ConfigureEndpoints(&Mouse_HID_Interface);
 
        USB_Device_EnableSOFEvents();
 
        USB_Device_EnableSOFEvents();
+
+       LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
 }
 
 /** Event handler for the library USB Unhandled Control Request event. */
 }
 
 /** Event handler for the library USB Unhandled Control Request event. */
@@ -165,8 +164,11 @@ void EVENT_USB_Device_StartOfFrame(void)
  *
  *  \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
  */
  *
  *  \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent
  */
-bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,
-                                         const uint8_t ReportType, void* ReportData, uint16_t* const ReportSize)
+bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
+                                         uint8_t* const ReportID,
+                                         const uint8_t ReportType,
+                                         void* ReportData,
+                                         uint16_t* const ReportSize)
 {
        uint8_t JoyStatus_LCL    = Joystick_GetStatus();
        uint8_t ButtonStatus_LCL = Buttons_GetStatus();
 {
        uint8_t JoyStatus_LCL    = Joystick_GetStatus();
        uint8_t ButtonStatus_LCL = Buttons_GetStatus();
@@ -232,8 +234,11 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
  *  \param[in] ReportData  Pointer to a buffer where the created report has been stored
  *  \param[in] ReportSize  Size in bytes of the received HID report
  */
-void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,
-                                          const uint8_t ReportType, const void* ReportData, const uint16_t ReportSize)
+void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo,
+                                          const uint8_t ReportID,
+                                          const uint8_t ReportType,
+                                          const void* ReportData,
+                                          const uint16_t ReportSize)
 {
        if (HIDInterfaceInfo == &Keyboard_HID_Interface)
        {
 {
        if (HIDInterfaceInfo == &Keyboard_HID_Interface)
        {