IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2011-06-11 06:52:16 (12 years 9 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 2acdaca218676655cfb182a355e39a133cbdc8e9 |
Message: | 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 |
Files: |
atusb/fw/atusb.c (1 diff) atusb/fw/board.c (1 diff) atusb/fw/board.h (1 diff) atusb/fw/board_app.c (1 diff) |
Change Details
atusb/fw/atusb.c | ||
---|---|---|
34 | 34 | |
35 | 35 | usb_init(); |
36 | 36 | ep0_init(); |
37 | timer_init(); | |
37 | 38 | |
38 | 39 | while (1) { |
39 | 40 | usb_poll(); |
atusb/fw/board.c | ||
---|---|---|
135 | 135 | CLKPR = 1 << CLKPCE; |
136 | 136 | CLKPR = 0; |
137 | 137 | |
138 | /* configure timer 1 as a free-running CLK counter */ | |
139 | ||
140 | TCCR1A = 0; | |
141 | TCCR1B = 1 << CS10; | |
142 | ||
143 | 138 | get_sernum(); |
144 | 139 | } |
atusb/fw/board.h | ||
---|---|---|
79 | 79 | |
80 | 80 | void timer_poll(void); |
81 | 81 | uint64_t timer_read(void); |
82 | void timer_init(void); | |
82 | 83 | |
83 | 84 | int gpio(uint8_t port, uint8_t data, uint8_t dir, uint8_t mask, uint8_t *res); |
84 | 85 |
atusb/fw/board_app.c | ||
---|---|---|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
77 | void timer_init(void) | |
78 | { | |
79 | /* configure timer 1 as a free-running CLK counter */ | |
80 | ||
81 | TCCR1A = 0; | |
82 | TCCR1B = 1 << CS10; | |
83 | } | |
84 | ||
85 | ||
77 | 86 | int gpio(uint8_t port, uint8_t data, uint8_t dir, uint8_t mask, uint8_t *res) |
78 | 87 | { |
79 | 88 | switch (port) { |