mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
elan: Simplify calibration check for ELAN_0C42
Check for the mean calibration being outside of range to know whether we require a recalibration. Continue with the usual checks if the calibration value is within range.
This commit is contained in:
@@ -603,6 +603,14 @@ static int elan_need_calibration(struct elan_dev *elandev)
|
|||||||
|
|
||||||
g_assert(frame_size != 0);
|
g_assert(frame_size != 0);
|
||||||
|
|
||||||
|
if (elandev->dev_type == ELAN_0C42) {
|
||||||
|
if (calib_mean > 5500 ||
|
||||||
|
calib_mean < 2500) {
|
||||||
|
fp_dbg("Forcing needed recalibration");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < frame_size; i++)
|
for (int i = 0; i < frame_size; i++)
|
||||||
bg_mean += elandev->background[i];
|
bg_mean += elandev->background[i];
|
||||||
bg_mean /= frame_size;
|
bg_mean /= frame_size;
|
||||||
|
|||||||
Reference in New Issue
Block a user