Clamp PID_LOOP_COUNT

This commit is contained in:
Oleg
2024-05-26 02:10:18 +03:00
parent a3995d2cc5
commit 440a42d3fe

View File

@@ -499,6 +499,9 @@ static void pidff_playback_pid(struct pidff_device *pidff, int pid_id, int n)
} else { } else {
pidff->effect_operation_status->value[0] = pidff->effect_operation_status->value[0] =
pidff->operation_id[PID_EFFECT_START]; pidff->operation_id[PID_EFFECT_START];
n = clamp(n, pidff->effect_operation[PID_LOOP_COUNT].field->logical_minimum,
pidff->effect_operation[PID_LOOP_COUNT].field->logical_maximum);
pidff->effect_operation[PID_LOOP_COUNT].value[0] = n; pidff->effect_operation[PID_LOOP_COUNT].value[0] = n;
} }