projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set all CDC and MassStorage device mode demos (LowLevel and ClassDriver) to use the...
[pub/USBasp.git]
/
Demos
/
Host
/
LowLevel
/
MouseHostWithParser
/
MouseHostWithParser.c
diff --git
a/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
b/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
index
42865e5
..
8ea5e72
100644
(file)
--- a/
Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
+++ b/
Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.c
@@
-166,9
+166,6
@@
void Mouse_HID_Task(void)
break;
\r
}
\r
\r
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
puts_P(PSTR("Processing HID Report.\r\n"));
\r
\r
/* Get and process the device's first HID report descriptor */
\r
@@
-186,10
+183,10
@@
void Mouse_HID_Task(void)
}
\r
\r
puts_P(PSTR("Mouse Enumerated.\r\n"));
\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
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
/* Select and unfreeze mouse data pipe */
\r
Pipe_SelectPipe(MOUSE_DATAPIPE);
\r
Pipe_Unfreeze();
\r
@@
-263,12
+260,7
@@
void ProcessMouseReport(uint8_t* MouseReport)
if (!(FoundData))
\r
continue;
\r
\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
\r
/* Determine if the report is for the X or Y delta movement */
\r
if (ReportItem->Attributes.Usage.Usage == USAGE_X)
\r