diff --git a/libfprint/drivers/elan.c b/libfprint/drivers/elan.c index 09b65c2..b15380b 100644 --- a/libfprint/drivers/elan.c +++ b/libfprint/drivers/elan.c @@ -564,18 +564,12 @@ capture_run_state (FpiSsm *ssm, FpDevice *dev) r = elan_save_img_frame (self); if (r < 0) { - /* Frame was indistinguishable from background (dark frame / finger lifted - * mid-capture). Treat as end-of-swipe rather than hard failure — the - * frames already accumulated may still be usable. */ + /* Frame was indistinguishable from background — treat as end-of-swipe */ fpi_ssm_mark_completed (ssm); } else if (self->num_frames < ELAN_MAX_FRAMES) { - /* Loop back via WAIT_FINGER so the device can re-arm its finger - * detection. ELAN_FINGER_TIMEOUT controls how long to wait — if - * the finger is still pressed the device returns 0x55 again and - * we capture another frame; if the finger is lifted it times out - * and capture ends. A longer timeout allows tap/hold behaviour. */ + /* quickly stop if finger is removed */ self->cmd_timeout = ELAN_FINGER_TIMEOUT; fpi_ssm_jump_to_state (ssm, CAPTURE_WAIT_FINGER); } @@ -770,7 +764,7 @@ calibrate_run_state (FpiSsm *ssm, FpDevice *dev) if (self->calib_status == 0x00 && self->last_read[0] == 0x01) self->calib_status = 0x01; - fpi_ssm_next_state_delayed (ssm, 100); + fpi_ssm_next_state_delayed (ssm, 50); } break; @@ -1016,7 +1010,5 @@ fpi_device_elan_class_init (FpiDeviceElanClass *klass) img_class->deactivate = dev_deactivate; img_class->change_state = dev_change_state; - img_class->bz3_threshold = 2; - - dev_class->nr_enroll_stages = 10; + img_class->bz3_threshold = 24; } diff --git a/libfprint/drivers/elan.h b/libfprint/drivers/elan.h index 0aac905..fe64658 100644 --- a/libfprint/drivers/elan.h +++ b/libfprint/drivers/elan.h @@ -47,10 +47,10 @@ /* times to retry reading calibration status during one session * generally prevents calibration from looping indefinitely */ -#define ELAN_CALIBRATION_ATTEMPTS 100 +#define ELAN_CALIBRATION_ATTEMPTS 10 /* min and max frames in a capture */ -#define ELAN_MIN_FRAMES 1 +#define ELAN_MIN_FRAMES 7 #define ELAN_MAX_FRAMES 30 /* crop frames to this height to improve stitching */ @@ -58,7 +58,7 @@ /* number of frames to drop at the end of capture because frames captured * while the finger is being lifted can be bad */ -#define ELAN_SKIP_LAST_FRAMES 0 +#define ELAN_SKIP_LAST_FRAMES 2 #define ELAN_CMD_LEN 0x2 #define ELAN_EP_CMD_OUT (0x1 | FPI_USB_ENDPOINT_OUT) @@ -71,7 +71,7 @@ /* usual command timeout and timeout for when we need to check if the finger is * still on the device */ #define ELAN_CMD_TIMEOUT 10000 -#define ELAN_FINGER_TIMEOUT 350 +#define ELAN_FINGER_TIMEOUT 200 G_DECLARE_FINAL_TYPE (FpiDeviceElan, fpi_device_elan, FPI, DEVICE_ELAN, FpImageDevice);