diff options
Diffstat (limited to 'tmk_core/common/avr/timer.c')
| -rw-r--r-- | tmk_core/common/avr/timer.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tmk_core/common/avr/timer.c b/tmk_core/common/avr/timer.c index 369015200d..b7d4f060ef 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; }} |
| 28 | volatile uint32_t timer_count; | 28 | volatile uint32_t timer_count; |
| 29 | 29 | ||
| 30 | /** \brief timer initialization | ||
| 31 | * | ||
| 32 | * FIXME: needs doc | ||
| 33 | */ | ||
| 30 | void timer_init(void) | 34 | void 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 | */ | ||
| 63 | inline | 71 | inline |
| 64 | void timer_clear(void) | 72 | void 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 | */ | ||
| 71 | inline | 83 | inline |
| 72 | uint16_t timer_read(void) | 84 | uint16_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 | */ | ||
| 83 | inline | 99 | inline |
| 84 | uint32_t timer_read32(void) | 100 | uint32_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 | */ | ||
| 95 | inline | 115 | inline |
| 96 | uint16_t timer_elapsed(uint16_t last) | 116 | uint16_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 | */ | ||
| 107 | inline | 131 | inline |
| 108 | uint32_t timer_elapsed32(uint32_t last) | 132 | uint32_t timer_elapsed32(uint32_t last) |
| 109 | { | 133 | { |
