mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-01-11 08:02:57 +00:00
Some cleanup
This commit is contained in:
@@ -33,7 +33,7 @@ __attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int1
|
||||
}
|
||||
void pointing_device_task(void) {
|
||||
report_mouse_t mouse_report = pointing_device_get_report();
|
||||
#if 1
|
||||
|
||||
static uint16_t x = 0, y = 0;
|
||||
int8_t report_x = 0, report_y = 0;
|
||||
|
||||
@@ -47,28 +47,19 @@ void pointing_device_task(void) {
|
||||
x = touchData.xValue;
|
||||
y = touchData.yValue;
|
||||
|
||||
if (rTouchData.buttonFlags) {
|
||||
mouse_report.buttons |= MOUSE_BTN1;
|
||||
} else {
|
||||
mouse_report.buttons &= ~MOUSE_BTN1;
|
||||
}
|
||||
|
||||
#else
|
||||
Pinnacle_GetRelative(&rTouchData);
|
||||
|
||||
mouse_report.x = rTouchData.xValue;
|
||||
mouse_report.y = rTouchData.yValue;
|
||||
//xprintf("%d", result->buttonFlags);
|
||||
xprintf("\n");
|
||||
if (rTouchData.buttonFlags) {
|
||||
mouse_report.buttons |= MOUSE_BTN1;
|
||||
} else {
|
||||
mouse_report.buttons &= ~MOUSE_BTN1;
|
||||
}
|
||||
|
||||
rTouchData.xValue = 0;
|
||||
rTouchData.yValue = 0;
|
||||
#if 0
|
||||
mouse_report.buttons = touchData.buttonFlags;
|
||||
#endif
|
||||
|
||||
#if defined(CONSOLE_ENABLE)
|
||||
print_byte(touchData.xValue);
|
||||
print_byte(touchData.yValue);
|
||||
print_byte(touchData.zValue);
|
||||
print_byte(touchData.buttonFlags);
|
||||
print_byte(touchData.touchDown);
|
||||
xprintf("\n");
|
||||
#endif
|
||||
|
||||
process_mouse_user(&mouse_report, report_x, report_y);
|
||||
pointing_device_set_report(mouse_report);
|
||||
pointing_device_send();
|
||||
@@ -117,8 +108,7 @@ void Pinnacle_GetAbsolute(absData_t* result) {
|
||||
result->yValue = data[3] | ((data[4] & 0xF0) << 4);
|
||||
result->zValue = data[5] & 0x3F;
|
||||
|
||||
|
||||
result->touchDown = result->xValue != 0;
|
||||
result->touchDown = (result->xValue != 0 || result->yValue != 0);
|
||||
}
|
||||
|
||||
void Pinnacle_GetRelative(relData_t* result) {
|
||||
|
||||
Reference in New Issue
Block a user