break;\r
}\r
\r
- USB_HostState = HOST_STATE_Configured;\r
- break;\r
- case HOST_STATE_Configured:\r
puts_P(PSTR("Processing HID Report.\r\n"));\r
\r
/* Get and process the device's first HID report descriptor */\r
}\r
\r
puts_P(PSTR("Mouse Enumerated.\r\n"));\r
- \r
- USB_HostState = HOST_STATE_Ready;\r
+\r
+ USB_HostState = HOST_STATE_Configured;\r
break;\r
- case HOST_STATE_Ready:\r
+ case HOST_STATE_Configured:\r
/* Select and unfreeze mouse data pipe */\r
Pipe_SelectPipe(MOUSE_DATAPIPE); \r
Pipe_Unfreeze();\r
if (!(FoundData))\r
continue;\r
\r
- int16_t DeltaMovement;\r
- \r
- if (ReportItem->Attributes.BitSize > 8)\r
- DeltaMovement = (int16_t)ReportItem->Value;\r
- else\r
- DeltaMovement = (int8_t)ReportItem->Value;\r
+ int16_t DeltaMovement = (int16_t)(ReportItem->Value << (16 - ReportItem->Attributes.BitSize));\r
\r
/* Determine if the report is for the X or Y delta movement */\r
if (ReportItem->Attributes.Usage.Usage == USAGE_X)\r