-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimer0.h
35 lines (29 loc) · 930 Bytes
/
timer0.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* timer0.h
*
* Author: Peter Sutton
*
* We set up timer 0 to give us an interrupt
* every millisecond. Tasks that have to occur
* regularly (every millisecond or few) can be added
* to the interrupt handler (in timer0.c) or can
* be added to the main event loop that checks the
* clock tick value. This value (32 bits) can be
* obtained using the get_clock_ticks() function.
* (Any tasks undertaken in the interrupt handler
* should be kept short so that we don't run the
* risk of missing an interrupt in future.)
*/
#ifndef TIMER0_H_
#define TIMER0_H_
#include <stdint.h>
/* Set up our timer to give us an interrupt every millisecond
* and update our time reference.
*/
void init_timer0(void);
void set_current_time(uint32_t time);
/* Return the current clock tick value - milliseconds since the timer was
* initialised.
*/
uint32_t get_current_time(void);
#endif