]>
git.gir.st - tmk_keyboard.git/blob - timer.c
2 #include <avr/interrupt.h>
6 uint16_t timer_count
= 0;
8 // Configure timer 0 to generate a timer overflow interrupt every
9 // 256*1024 clock cycles, or approx 61 Hz when using 16 MHz clock
10 // This demonstrates how to use interrupts to implement a simple
11 // inactivity timeout.
20 void timer_clear(void)
28 uint16_t timer_read(void)
41 uint16_t timer_elapsed(uint16_t last
)
50 return TIMER_DIFF(t
, last
);
53 // This interrupt routine is run approx 61 times per second.
54 // A very simple inactivity timeout is implemented, where we
55 // will send a space character and print a message to the
56 // hid_listen debug message window.