summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorSadeep Madurange <sadeep@asciimx.com>2025-05-03 20:49:58 +0800
committerSadeep Madurange <sadeep@asciimx.com>2025-05-03 20:51:14 +0800
commit7f5a4782dc5428884dd1b7163196ff7363fb15d7 (patch)
treece06905c0ce24222ea2536b1c1c63b8ddbd3b64f /main.c
parentd04b071a2bdfb1ed87c750416aab4424202353af (diff)
downloadavr-fpm-drivers-7f5a4782dc5428884dd1b7163196ff7363fb15d7.tar.gz
Update readme.
Diffstat (limited to 'main.c')
-rw-r--r--main.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/main.c b/main.c
index cde37e3..3ee8fc6 100644
--- a/main.c
+++ b/main.c
@@ -100,30 +100,24 @@ int main(void)
snprintf(s, 30, "Template count: %d", template_count);
uart_write(s);
- uart_write("Enroll fingerprint");
- _delay_ms(2000);
- if (fpm_enroll()) {
- uart_write("Enrolled fingerprint");
- } else {
- uart_write("Enrollment error");
+ if (template_count == 0) {
+ uart_write("Enroll fingerprint");
+ if (fpm_enroll()) {
+ uart_write("Enrolled fingerprint");
+ } else {
+ uart_write("Enrollment error");
+ }
+
+ template_count = fpm_getcount();
+ snprintf(s, 30, "New template count: %d", template_count);
+ uart_write(s);
}
- template_count = fpm_getcount();
- snprintf(s, 30, "New template count: %d", template_count);
- uart_write(s);
-
- //uart_write("Authentcate");
- //_delay_ms(1000);
- //
- //do {
- // ismatch = fpm_match();
- // if (ismatch)
- // uart_write("Matched!");
- // else {
- // uart_write("No match!");
- // _delay_ms(1500);
- // }
- //} while (!ismatch);
+ uart_write("Authentcating...");
+ if (fpm_match())
+ uart_write("Fingerprint match");
+ else
+ uart_write("No match");
}
while (1)