commit e55f842adcccb6fc82e734d92e45db74441f523f
parent 11c6a5f810b5e98f9d5b3f8abdf961a5584c6490
Author: mntmn <lukas@mntmn.com>
Date: Tue, 29 Oct 2019 14:42:20 +0100
fix pullups for all 5 buttons; fix wheel handling
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/reform-trackball-fw/Mouse.c b/reform-trackball-fw/Mouse.c
@@ -163,6 +163,9 @@ void SetupHardware(void)
output_high(PORTD, 0); // enable input pullup for LMB
output_high(PORTD, 1); // enable input pullup for RMB
+ output_high(PORTD, 2); // enable input pullup for RMB
+ output_high(PORTD, 3); // enable input pullup for RMB
+ output_high(PORTD, 4); // enable input pullup for RMB
//output_high(PORTC, 5);
@@ -287,14 +290,15 @@ bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDIn
MouseReport->Wheel = 0;
if (!(PIND&(1<<1))) {
+ // wheel
MouseReport->Wheel = -ny/3;
led_error();
+ } else {
+ MouseReport->X = nx;
+ MouseReport->Y = ny;
}
-
- MouseReport->X = nx;
- MouseReport->Y = ny;
- *ReportSize = sizeof(USB_WheelMouseReport_Data_t);
+ *ReportSize = sizeof(USB_WheelMouseReport_Data_t);
return true;
}