fingerprintd/implementations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 3e06003fd0 Fold the matched frame at the moment it matches, not after the verdict
Template learning was doing nothing. Across three measured trials, six presses
matched and five of them folded zero frames: the harvest captured a NEW frame
before folding, and by the time it ran the finger was gone, so the capture read
the idle floor and the loop exited. Every press in those trials was exactly one
frame long -- a tap lasts 400 to 600 ms and a frame costs 200 to 300, so there
is never a second frame to harvest.

Stock does not capture first. In the reference trace UPDATE_TEMPLATE follows
do_authenticate directly -- auth success score, authenticated result is updated,
CANCEL, checking the template, UPDATE_TEMPLATE -- with no CAPTURE_IMAGE between
them. The trustlet still holds the image it just matched against, so the frame
that produced the verdict is the frame to fold, and it costs one command with
nothing on the sensor.

So the fold happens at the match site now, and the harvest continues from slot
one for as long as the finger actually stays down. A quick tap folds exactly one
frame instead of none, which is the case that matters: a quick tap is what a
user does.

The touch-frame flag follows the event that carried the verdict, so a match on
the rising edge sets bit 6 exactly as stock does.
2026-09-04 23:28:06 +02:00
..
main.cpp Fold the matched frame at the moment it matches, not after the verdict 2026-09-04 23:28:06 +02:00