From 7428dc1a2663294a5903bdfd6373141a20fb934d Mon Sep 17 00:00:00 2001 From: Daniel Kao Date: Sun, 26 Jun 2022 13:49:03 -0700 Subject: [PATCH] cirque pointing driver: Adjust configuration functions --- quantum/pointing_device_drivers.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/quantum/pointing_device_drivers.c b/quantum/pointing_device_drivers.c index af23a5d61bf8..0ff3f293d7b5 100644 --- a/quantum/pointing_device_drivers.c +++ b/quantum/pointing_device_drivers.c @@ -269,7 +269,8 @@ void cirque_pinnacle_enable_circular_scroll(bool enable) { features.circular_scroll_enable = enable; } -void cirque_pinnacle_set_circular_scroll_settings(float outer_ring_pct, float movement_pct, float movement_ratio, uint8_t wheel_clicks) { +// To set a trackpad exclusively as scroll wheel: outer_ring_pct = 100, movement_pct = 0, movement_ratio = 0 +void cirque_pinnacle_configure_circular_scroll(float outer_ring_pct, float movement_pct, float movement_ratio, uint8_t wheel_clicks) { scroll.outer_ring_pct = outer_ring_pct; scroll.movement_pct = movement_pct; scroll.movement_ratio = movement_ratio; @@ -296,7 +297,7 @@ typedef struct { mouse_xy_report_t dy0; } cursor_glide_context_t; -static cursor_glide_context_t glide; +static cursor_glide_context_t glide = {.trigger_pct = 2}; static cursor_glide_t cursor_glide(void) { cursor_glide_t report; @@ -334,15 +335,14 @@ static cursor_glide_t cursor_glide_check(void) { static cursor_glide_t cursor_glide_start(void) { cursor_glide_t invalid_report = {0, 0, false}; - glide.trigger_pct = 2; // good enough default - glide.coef = 0.4; // good enough default - glide.interval = 10; // hardcode for 100sps - glide.timer = timer_read(); - glide.counter = 0; - glide.v0 = (glide.dx0 == 0 && glide.dy0 == 0) ? 0.0 : hypotf(glide.dx0, glide.dy0); // skip trigonometry if not needed - glide.x = 0; - glide.y = 0; - glide.z = 0; + glide.coef = 0.4; // good enough default + glide.interval = 10; // hardcode for 100sps + glide.timer = timer_read(); + glide.counter = 0; + glide.v0 = (glide.dx0 == 0 && glide.dy0 == 0) ? 0.0 : hypotf(glide.dx0, glide.dy0); // skip trigonometry if not needed + glide.x = 0; + glide.y = 0; + glide.z = 0; if (glide.v0 < glide.trigger_pct * cirque_pinnacle_get_scale() / 100) { // not enough velocity to be worth gliding, abort @@ -365,6 +365,10 @@ void cirque_pinnacle_enable_cursor_glide(bool enable) { features.cursor_glide_enable = enable; } +void cirque_pinnacle_configure_cursor_glide(float trigger_pct) { + glide.trigger_pct = trigger_pct; +} + report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) { pinnacle_data_t touchData = cirque_pinnacle_read_data(); circular_scroll_t scroll_report;