elanspi: Move debug print so that it contains all information

Two of the printed variables were only calculated after the message was
printed, making the logged information less useful than it could be.
This commit is contained in:
Benjamin Berg
2021-12-02 13:28:12 +01:00
parent 05fd2c58cb
commit 31afd3ba5c

View File

@@ -1219,8 +1219,6 @@ elanspi_guess_image (FpiDeviceElanSpi *self, guint16 *raw_image)
sq_stddev /= (frame_width * frame_height);
fp_dbg ("<guess> stddev=%" G_GUINT64_FORMAT "d, ip=%d, is_fp=%d, is_empty=%d", sq_stddev, invalid_percent, is_fp, is_empty);
if (invalid_percent < ELANSPI_MAX_REAL_INVALID_PERCENT)
is_fp += 1;
if (invalid_percent > ELANSPI_MIN_EMPTY_INVALID_PERCENT)
@@ -1231,6 +1229,8 @@ elanspi_guess_image (FpiDeviceElanSpi *self, guint16 *raw_image)
if (sq_stddev < ELANSPI_MAX_EMPTY_STDDEV)
is_empty += 1;
fp_dbg ("<guess> stddev=%" G_GUINT64_FORMAT "d, ip=%d, is_fp=%d, is_empty=%d", sq_stddev, invalid_percent, is_fp, is_empty);
if (is_fp > is_empty)
return ELANSPI_GUESS_FINGERPRINT;
else if (is_empty > is_fp)