Fixed Host mode HID class driver not sending the correct report type when HID_Host_Se...
[pub/USBasp.git] / Demos / Device / ClassDriver / Mouse / Mouse.c
index 8e093ef..96af145 100644 (file)
@@ -1,13 +1,13 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
@@ -66,6 +66,7 @@ int main(void)
        SetupHardware();\r
        \r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
        SetupHardware();\r
        \r
        LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
+       sei();\r
 \r
        for (;;)\r
        {\r
 \r
        for (;;)\r
        {\r
@@ -155,7 +156,7 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
          MouseReport->X =  1;\r
 \r
        if (JoyStatus_LCL & JOY_PRESS)\r
          MouseReport->X =  1;\r
 \r
        if (JoyStatus_LCL & JOY_PRESS)\r
-         MouseReport->Button  = (1 << 0);\r
+         MouseReport->Button |= (1 << 0);\r
          \r
        if (ButtonStatus_LCL & BUTTONS_BUTTON1)\r
          MouseReport->Button |= (1 << 1);\r
          \r
        if (ButtonStatus_LCL & BUTTONS_BUTTON1)\r
          MouseReport->Button |= (1 << 1);\r