diff options
author | tmk <nobody@nowhere> | 2010-10-29 15:17:18 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2010-10-30 01:16:47 +0900 |
commit | 45d4a7a89883c3433604d4e011b665796a583008 (patch) | |
tree | b9ff5306dc5eb9a06d7e4a2fb7d0873a9b30606d /timer.h | |
parent | 6c3b9a2ded1afcf4a6bbc69878f52088f4c1a0e8 (diff) | |
download | qmk_firmware-45d4a7a89883c3433604d4e011b665796a583008.tar.gz |
improve layer switching
Diffstat (limited to 'timer.h')
-rw-r--r-- | timer.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/timer.h b/timer.h new file mode 100644 index 000000000..8ddf9e7e2 --- /dev/null +++ b/timer.h @@ -0,0 +1,17 @@ +#ifndef TIMER_H +#define TIMER_H 1 + +#include <stdint.h> + +#define TIMER_DIFF(a, b) ((a) >= (b) ? (a) - (b) : UINT16_MAX - (b) + (a)) + + +extern uint16_t timer_count; + + +void timer_init(void); +void timer_clear(void); +uint16_t timer_read(void); +uint16_t timer_elapsed(uint16_t last); + +#endif |