Device mode class driver callbacks are now fired before the control request status...
[pub/USBasp.git] / Demos / Device / ClassDriver / KeyboardMouse / KeyboardMouse.c
index af6e839..94f27bd 100644 (file)
@@ -8,7 +8,6 @@
 \r
 /*\r
   Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
 /*\r
   Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
-  Copyright 2010  Denver Gingerich (denver [at] ossguy [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
@@ -90,6 +89,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
@@ -217,7 +217,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
                *ReportSize = sizeof(USB_MouseReport_Data_t);\r
                return true;            \r
                \r
                *ReportSize = sizeof(USB_MouseReport_Data_t);\r
                return true;            \r