diff options
| -rw-r--r-- | main.c | 3 | ||||
| -rw-r--r-- | r503.c | 10 | ||||
| -rw-r--r-- | r503.h | 2 |
3 files changed, 10 insertions, 5 deletions
@@ -44,8 +44,7 @@ int main(void) fpm_get_cfg(&cfg); if (fpm_get_count() == 0) { - // todo: check against capacity in prod - if (fpm_enroll(1)) { + if (fpm_enroll()) { fpm_led_on(BLUE); _delay_ms(500); fpm_led_off(); @@ -263,11 +263,17 @@ uint16_t fpm_get_count(void) return count; } -uint8_t fpm_enroll(uint16_t id) +uint8_t fpm_enroll(void) { - uint16_t n; + struct fpm_cfg cfg; + uint16_t n, id; uint8_t buf[MAXPDLEN]; + fpm_get_cfg(&cfg); + id = fpm_get_count(); + if (n == cfg.cap) + return 0; + if (!scan()) return 0; @@ -31,7 +31,7 @@ void fpm_led_off(void); uint16_t fpm_get_count(void); -uint8_t fpm_enroll(uint16_t id); +uint8_t fpm_enroll(void); uint8_t fpm_match(void); |
