summaryrefslogtreecommitdiffstats
path: root/lock/scan.c
blob: 6784e9a25c8dc0c8564fde2e338061e66f7d8d25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* Lock front, connected to the fingerprint scanner */

#include <stdint.h>
#include <stdlib.h>

#include <avr/interrupt.h>
#include <avr/wdt.h>
#include <util/delay.h>

#include "nrfm.h"
#include "uart.h"
#include "util.h"

int main(void)
{
	uint8_t n;
	uint8_t rxaddr[ADDRLEN] = { 194, 178, 82 };

	char buf[WDLEN + 1], msg[WDLEN + 1];

	/* timer for keygen */
	TCCR1A |= (1 << WGM11) | (1 << COM1A1);
	TCCR1B |= (1 << WGM13) | (1 << CS11);
	ICR1 = 20000;

	wdt_init();
	uart_init();
	radio_init(rxaddr);
	radio_print_config();

	sei();

	for (;;) {
		wdt_reset();
		_delay_ms(2000);
	}

	return 0;
}