summaryrefslogtreecommitdiffstats
path: root/quantum/pointing_device
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/pointing_device')
-rw-r--r--quantum/pointing_device/pointing_device.c8
-rw-r--r--quantum/pointing_device/pointing_device_drivers.c22
2 files changed, 10 insertions, 20 deletions
diff --git a/quantum/pointing_device/pointing_device.c b/quantum/pointing_device/pointing_device.c
index 505a7a6ffd..ae3f122e89 100644
--- a/quantum/pointing_device/pointing_device.c
+++ b/quantum/pointing_device/pointing_device.c
@@ -166,11 +166,9 @@ __attribute__((weak)) void pointing_device_send(void) {
host_mouse_send(&local_mouse_report);
}
// send it and 0 it out except for buttons, so those stay until they are explicity over-ridden using update_pointing_device
- local_mouse_report.x = 0;
- local_mouse_report.y = 0;
- local_mouse_report.v = 0;
- local_mouse_report.h = 0;
-
+ uint8_t buttons = local_mouse_report.buttons;
+ memset(&local_mouse_report, 0, sizeof(local_mouse_report));
+ local_mouse_report.buttons = buttons;
memcpy(&old_report, &local_mouse_report, sizeof(local_mouse_report));
}
diff --git a/quantum/pointing_device/pointing_device_drivers.c b/quantum/pointing_device/pointing_device_drivers.c
index b96f8ff4b3..096ad5d028 100644
--- a/quantum/pointing_device/pointing_device_drivers.c
+++ b/quantum/pointing_device/pointing_device_drivers.c
@@ -17,6 +17,7 @@
*/
#include "pointing_device.h"
+#include "pointing_device_internal.h"
#include "debug.h"
#include "wait.h"
#include "timer.h"
@@ -32,10 +33,7 @@ report_mouse_t adns5050_get_report(report_mouse_t mouse_report) {
report_adns5050_t data = adns5050_read_burst();
if (data.dx != 0 || data.dy != 0) {
-# ifdef CONSOLE_ENABLE
- if (debug_mouse) dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
-# endif
-
+ pd_dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
mouse_report.x = (mouse_xy_report_t)data.dx;
mouse_report.y = (mouse_xy_report_t)data.dy;
}
@@ -76,9 +74,7 @@ const pointing_device_driver_t pointing_device_driver = {
report_mouse_t analog_joystick_get_report(report_mouse_t mouse_report) {
report_analog_joystick_t data = analog_joystick_read();
-# ifdef CONSOLE_ENABLE
- if (debug_mouse) dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y);
-# endif
+ pd_dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y);
mouse_report.x = data.x;
mouse_report.y = data.y;
@@ -140,11 +136,9 @@ report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) {
return mouse_report;
}
-# if CONSOLE_ENABLE
- if (debug_mouse && touchData.touchDown) {
- dprintf("cirque_pinnacle touchData x=%4d y=%4d z=%2d\n", touchData.xValue, touchData.yValue, touchData.zValue);
+ if (touchData.touchDown) {
+ pd_dprintf("cirque_pinnacle touchData x=%4d y=%4d z=%2d\n", touchData.xValue, touchData.yValue, touchData.zValue);
}
-# endif
// Scale coordinates to arbitrary X, Y resolution
cirque_pinnacle_scale_data(&touchData, cirque_pinnacle_get_scale(), cirque_pinnacle_get_scale());
@@ -227,9 +221,7 @@ const pointing_device_driver_t pointing_device_driver = {
report_mouse_t paw3204_get_report(report_mouse_t mouse_report) {
report_paw3204_t data = paw3204_read();
if (data.isMotion) {
-# ifdef CONSOLE_ENABLE
- dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y);
-# endif
+ pd_dprintf("Raw ] X: %d, Y: %d\n", data.x, data.y);
mouse_report.x = data.x;
mouse_report.y = data.y;
@@ -329,7 +321,7 @@ report_mouse_t pmw33xx_get_report(report_mouse_t mouse_report) {
if (!in_motion) {
in_motion = true;
- dprintf("PWM3360 (0): starting motion\n");
+ pd_dprintf("PWM3360 (0): starting motion\n");
}
mouse_report.x = CONSTRAIN_HID_XY(report.delta_x);