filter: a few whitespace fixes and extra comments
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 2 Sep 2022 04:18:26 +0000 (14:18 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 7 Sep 2022 23:03:15 +0000 (09:03 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/filter-mouse.c
src/filter-touchpad-flat.c
src/filter.c

index 0c2f1fe..470175f 100644 (file)
@@ -81,11 +81,12 @@ calculate_acceleration_factor(struct pointer_accelerator *accel,
 
        trackers_feed(&accel->trackers, unaccelerated, time);
        velocity = trackers_velocity(&accel->trackers, time);
+       /* This will call into our pointer_accel_profile_linear() profile func */
        accel_factor = calculate_acceleration_simpsons(&accel->base,
                                                       accel->profile,
                                                       data,
-                                                      velocity,
-                                                      accel->last_velocity,
+                                                      velocity, /* normalized coords */
+                                                      accel->last_velocity, /* normalized coords */
                                                       time);
        accel->last_velocity = velocity;
 
index e69e7af..bb6c31a 100644 (file)
@@ -46,8 +46,8 @@ struct touchpad_accelerator_flat {
 
 static struct normalized_coords
 accelerator_filter_touchpad_flat(struct motion_filter *filter,
-                       const struct device_float_coords *unaccelerated,
-                       void *data, uint64_t time)
+                                const struct device_float_coords *unaccelerated,
+                                void *data, uint64_t time)
 {
        struct touchpad_accelerator_flat *accel =
                (struct touchpad_accelerator_flat *)filter;
@@ -66,8 +66,8 @@ accelerator_filter_touchpad_flat(struct motion_filter *filter,
 
 static struct normalized_coords
 accelerator_filter_noop_touchpad_flat(struct motion_filter *filter,
-                            const struct device_float_coords *unaccelerated,
-                            void *data, uint64_t time)
+                                     const struct device_float_coords *unaccelerated,
+                                     void *data, uint64_t time)
 {
        struct touchpad_accelerator_flat *accel =
                (struct touchpad_accelerator_flat *) filter;
@@ -82,7 +82,7 @@ accelerator_filter_noop_touchpad_flat(struct motion_filter *filter,
 
 static bool
 accelerator_set_speed_touchpad_flat(struct motion_filter *filter,
-                          double speed_adjustment)
+                                   double speed_adjustment)
 {
        struct touchpad_accelerator_flat *accel_filter =
                (struct touchpad_accelerator_flat *)filter;
index 0e30951..28df814 100644 (file)
@@ -189,8 +189,8 @@ trackers_velocity_after_timeout(struct pointer_tracker *tracker,
         * movement in normal use-cases (pause, move, pause, move)
         */
        return calculate_trackers_velocity(tracker,
-                                         tracker->time + MOTION_TIMEOUT,
-                                         smoothener);
+                                          tracker->time + MOTION_TIMEOUT,
+                                          smoothener);
 }
 
 /**
@@ -269,7 +269,8 @@ trackers_velocity(struct pointer_trackers *trackers, uint64_t time)
  *
  * @param accel The acceleration filter
  * @param data Caller-specific data
- * @param velocity Velocity in device-units per µs
+ * @param velocity Velocity - depending on the caller this may be in
+ *                device-units per µs or normalized per µs
  * @param last_velocity Previous velocity in device-units per µs
  * @param time Current time in µs
  *