aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/Mouse/Mouse.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2009-05-06 12:43:00 +0000
committerDean Camera <dean@fourwalledcubicle.com>2009-05-06 12:43:00 +0000
commita908773a13ee491f2f8907cdf57c26fb39e10658 (patch)
tree4672f5f9f37c4b271a63aab6313deb5a5a72b7ff /Demos/Device/Mouse/Mouse.c
parent63a8f66d92b5d7018a4d962f4f7b23774a621771 (diff)
downloadlufa-a908773a13ee491f2f8907cdf57c26fb39e10658.tar.gz
lufa-a908773a13ee491f2f8907cdf57c26fb39e10658.tar.bz2
lufa-a908773a13ee491f2f8907cdf57c26fb39e10658.zip
Change device demos to cache the board button values in the same manner as the board joystick to maintain consistency.
Diffstat (limited to 'Demos/Device/Mouse/Mouse.c')
-rw-r--r--Demos/Device/Mouse/Mouse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Demos/Device/Mouse/Mouse.c b/Demos/Device/Mouse/Mouse.c
index 7fff291f4..763d366e9 100644
--- a/Demos/Device/Mouse/Mouse.c
+++ b/Demos/Device/Mouse/Mouse.c
@@ -287,7 +287,8 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
*/
void CreateMouseReport(USB_MouseReport_Data_t* ReportData)
{
- uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ uint8_t JoyStatus_LCL = Joystick_GetStatus();
+ uint8_t ButtonStatus_LCL = Buttons_GetStatus();
/* Clear the report contents */
memset(ReportData, 0, sizeof(USB_MouseReport_Data_t));
@@ -305,7 +306,7 @@ void CreateMouseReport(USB_MouseReport_Data_t* ReportData)
if (JoyStatus_LCL & JOY_PRESS)
ReportData->Button = (1 << 0);
- if (Buttons_GetStatus() & BUTTONS_BUTTON1)
+ if (ButtonStatus_LCL & BUTTONS_BUTTON1)
ReportData->Button |= (1 << 1);
}