projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finish Class Driver MouseHost demo. Update HID Host Class driver; boot protocol now...
[pub/lufa.git]
/
Demos
/
Host
/
ClassDriver
/
MouseHost
/
MouseHost.c
diff --git
a/Demos/Host/ClassDriver/MouseHost/MouseHost.c
b/Demos/Host/ClassDriver/MouseHost/MouseHost.c
index
ead2961
..
926776f
100644
(file)
--- a/
Demos/Host/ClassDriver/MouseHost/MouseHost.c
+++ b/
Demos/Host/ClassDriver/MouseHost/MouseHost.c
@@
-115,10
+115,16
@@
int main(void)
{
\r
USB_MouseReport_Data_t MouseReport;
\r
uint8_t ReportID = 0;
\r
{
\r
USB_MouseReport_Data_t MouseReport;
\r
uint8_t ReportID = 0;
\r
- uint8_t LEDMask = LEDS_NO_LEDS;
\r
+ uint8_t LEDMask
= LEDS_NO_LEDS;
\r
\r
\r
+ /* Receive next boot protocol mouse report from the device */
\r
HID_Host_ReceiveReport(&Mouse_HID_Interface, false, &ReportID, &MouseReport);
\r
\r
HID_Host_ReceiveReport(&Mouse_HID_Interface, false, &ReportID, &MouseReport);
\r
\r
+ /* Print mouse report data through the serial port */
\r
+ printf_P(PSTR("dX:%2d dY:%2d Button:%d\r\n"), MouseReport.X,
\r
+ MouseReport.Y,
\r
+ MouseReport.Button);
\r
+
\r
/* Alter status LEDs according to mouse X movement */
\r
if (MouseReport.X > 0)
\r
LEDMask |= LEDS_LED1;
\r
/* Alter status LEDs according to mouse X movement */
\r
if (MouseReport.X > 0)
\r
LEDMask |= LEDS_LED1;
\r
@@
-134,13
+140,9
@@
int main(void)
/* Alter status LEDs according to mouse button position */
\r
if (MouseReport.Button)
\r
LEDMask = LEDS_ALL_LEDS;
\r
/* Alter status LEDs according to mouse button position */
\r
if (MouseReport.Button)
\r
LEDMask = LEDS_ALL_LEDS;
\r
-
\r
+
\r
LEDs_SetAllLEDs(LEDMask);
\r
}
\r
LEDs_SetAllLEDs(LEDMask);
\r
}
\r
- else
\r
- {
\r
- LEDs_SetAllLEDs(LEDS_NO_LEDS);
\r
- }
\r
\r
break;
\r
}
\r
\r
break;
\r
}
\r