mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 14:50:38 +02:00
atusb/fw/: moved timer initialization to board_app.c as well
- board.c (board_init), board_app.h (timer_init), board_app.c (timer_init): moved timer initialization from board_init to new function timer_init - atusb.c (main): call timer_init
This commit is contained in:
parent
2d7ee91430
commit
2acdaca218
@ -34,6 +34,7 @@ int main(void)
|
||||
|
||||
usb_init();
|
||||
ep0_init();
|
||||
timer_init();
|
||||
|
||||
while (1) {
|
||||
usb_poll();
|
||||
|
@ -135,10 +135,5 @@ void board_init(void)
|
||||
CLKPR = 1 << CLKPCE;
|
||||
CLKPR = 0;
|
||||
|
||||
/* configure timer 1 as a free-running CLK counter */
|
||||
|
||||
TCCR1A = 0;
|
||||
TCCR1B = 1 << CS10;
|
||||
|
||||
get_sernum();
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ void panic(void);
|
||||
|
||||
void timer_poll(void);
|
||||
uint64_t timer_read(void);
|
||||
void timer_init(void);
|
||||
|
||||
int gpio(uint8_t port, uint8_t data, uint8_t dir, uint8_t mask, uint8_t *res);
|
||||
|
||||
|
@ -74,6 +74,15 @@ uint64_t timer_read(void)
|
||||
}
|
||||
|
||||
|
||||
void timer_init(void)
|
||||
{
|
||||
/* configure timer 1 as a free-running CLK counter */
|
||||
|
||||
TCCR1A = 0;
|
||||
TCCR1B = 1 << CS10;
|
||||
}
|
||||
|
||||
|
||||
int gpio(uint8_t port, uint8_t data, uint8_t dir, uint8_t mask, uint8_t *res)
|
||||
{
|
||||
switch (port) {
|
||||
|
Loading…
Reference in New Issue
Block a user