From e0665507b1f137547d073e26ee465aa2dc5ea82e Mon Sep 17 00:00:00 2001 From: burkfers Date: Tue, 5 Mar 2024 16:13:10 +0100 Subject: [PATCH] fix: correct wrong transcription of acceleration factor calculation --- maccel/maccel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maccel/maccel.c b/maccel/maccel.c index db2030df7910..cc4d0fb4ccc8 100644 --- a/maccel/maccel.c +++ b/maccel/maccel.c @@ -135,7 +135,7 @@ report_mouse_t pointing_device_task_maccel(report_mouse_t mouse_report) { // correct raw velocity for dpi const float velocity = dpi_correction * velocity_raw; // calculate mouse acceleration factor: f(dv) = c - ((c-1) / ((1 + e^(x(x - b)) * a/z))) - const float maccel_factor = g_maccel_config.limit - (g_maccel_config.limit - 1) / powf(1 + expf(g_maccel_config.takeoff * (velocity - g_maccel_config.limit)), g_maccel_config.growth_rate / g_maccel_config.takeoff); + const float maccel_factor = g_maccel_config.limit - (g_maccel_config.limit - 1) / powf(1 + expf(g_maccel_config.takeoff * (velocity - g_maccel_config.offset)), g_maccel_config.growth_rate / g_maccel_config.takeoff); // calculate accelerated delta X and Y values and clamp: const mouse_xy_report_t x = CONSTRAIN_REPORT(mouse_report.x * maccel_factor); const mouse_xy_report_t y = CONSTRAIN_REPORT(mouse_report.y * maccel_factor);