Skip to content

Commit

Permalink
Merge branch 'main' into maccel-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
burkfers committed Mar 5, 2024
2 parents c863145 + e066550 commit be0bb2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion maccel/maccel.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,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);
Expand Down

0 comments on commit be0bb2b

Please sign in to comment.