aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/avr/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/avr/timer.c')
-rw-r--r--tmk_core/common/avr/timer.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tmk_core/common/avr/timer.c b/tmk_core/common/avr/timer.c
index 369015200..b7d4f060e 100644
--- a/tmk_core/common/avr/timer.c
+++ b/tmk_core/common/avr/timer.c
@@ -27,6 +27,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }} 27// NOTE: union { uint32_t timer32; struct { uint16_t dummy; uint16_t timer16; }}
28volatile uint32_t timer_count; 28volatile uint32_t timer_count;
29 29
30/** \brief timer initialization
31 *
32 * FIXME: needs doc
33 */
30void timer_init(void) 34void timer_init(void)
31{ 35{
32#if TIMER_PRESCALER == 1 36#if TIMER_PRESCALER == 1
@@ -60,6 +64,10 @@ void timer_init(void)
60#endif 64#endif
61} 65}
62 66
67/** \brief timer clear
68 *
69 * FIXME: needs doc
70 */
63inline 71inline
64void timer_clear(void) 72void timer_clear(void)
65{ 73{
@@ -68,6 +76,10 @@ void timer_clear(void)
68 } 76 }
69} 77}
70 78
79/** \brief timer read
80 *
81 * FIXME: needs doc
82 */
71inline 83inline
72uint16_t timer_read(void) 84uint16_t timer_read(void)
73{ 85{
@@ -80,6 +92,10 @@ uint16_t timer_read(void)
80 return (t & 0xFFFF); 92 return (t & 0xFFFF);
81} 93}
82 94
95/** \brief timer read32
96 *
97 * FIXME: needs doc
98 */
83inline 99inline
84uint32_t timer_read32(void) 100uint32_t timer_read32(void)
85{ 101{
@@ -92,6 +108,10 @@ uint32_t timer_read32(void)
92 return t; 108 return t;
93} 109}
94 110
111/** \brief timer elapsed
112 *
113 * FIXME: needs doc
114 */
95inline 115inline
96uint16_t timer_elapsed(uint16_t last) 116uint16_t timer_elapsed(uint16_t last)
97{ 117{
@@ -104,6 +124,10 @@ uint16_t timer_elapsed(uint16_t last)
104 return TIMER_DIFF_16((t & 0xFFFF), last); 124 return TIMER_DIFF_16((t & 0xFFFF), last);
105} 125}
106 126
127/** \brief timer elapsed32
128 *
129 * FIXME: needs doc
130 */
107inline 131inline
108uint32_t timer_elapsed32(uint32_t last) 132uint32_t timer_elapsed32(uint32_t last)
109{ 133{