summaryrefslogtreecommitdiff
path: root/keyboards/ploopyco/trackball_mini
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-05-14 02:21:08 +0000
committerQMK Bot <hello@qmk.fm>2021-05-14 02:21:08 +0000
commit8d85171f16617e6f64e62b796385b5aef97563e7 (patch)
tree6b9904bf464f8e909f154a9290c6c2a4eeb7f9d4 /keyboards/ploopyco/trackball_mini
parenteeb8ba4e62c9cc37843f12460afacfb5768e18ef (diff)
parenta6807d18222295a9a8016d21466f1ec71d73a34a (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/ploopyco/trackball_mini')
-rw-r--r--keyboards/ploopyco/trackball_mini/trackball_mini.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/keyboards/ploopyco/trackball_mini/trackball_mini.c b/keyboards/ploopyco/trackball_mini/trackball_mini.c
index 4ae5df0837..d6eb61a2b2 100644
--- a/keyboards/ploopyco/trackball_mini/trackball_mini.c
+++ b/keyboards/ploopyco/trackball_mini/trackball_mini.c
@@ -105,22 +105,8 @@ __attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
}
__attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) {
- // x and y are swapped
- // the sensor is rotated
- // by 90 degrees
- int16_t temp = x;
- x = y;
- y = temp;
-
- // Apply delta-X and delta-Y transformations.
- float xt = (float) x * ADNS_X_TRANSFORM;
- float yt = (float) y * ADNS_Y_TRANSFORM;
-
- int16_t xti = xt;
- int16_t yti = yt;
-
- mouse_report->x = xti;
- mouse_report->y = yti;
+ mouse_report->x = x;
+ mouse_report->y = y;
}
__attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
@@ -130,7 +116,17 @@ __attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
if (debug_mouse)
dprintf("Raw ] X: %d, Y: %d\n", data.dx, data.dy);
- process_mouse_user(mouse_report, data.dx, data.dy);
+ // Apply delta-X and delta-Y transformations.
+ // x and y are swapped
+ // the sensor is rotated
+ // by 90 degrees
+ float xt = (float) data.dy * ADNS_X_TRANSFORM;
+ float yt = (float) data.dx * ADNS_Y_TRANSFORM;
+
+ int16_t xti = (int16_t)xt;
+ int16_t yti = (int16_t)yt;
+
+ process_mouse_user(mouse_report, xti, yti);
}
}