]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * unzap firmware | |
3 | * | |
4 | * (c) by Alexander Neumann <alexander@lochraster.org> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program; if not, write to the Free Software | |
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
18 | * | |
19 | * For more information on the GPL, please go to: | |
20 | * http://www.gnu.org/copyleft/gpl.html | |
21 | */ | |
22 | ||
23 | /* small timer library, uses timer2 */ | |
24 | ||
25 | #ifndef __TIMER_H | |
26 | #define __TIMER_H | |
27 | ||
28 | #include <stdint.h> | |
29 | #include <stdbool.h> | |
30 | ||
31 | /* structures */ | |
32 | typedef struct { | |
33 | uint8_t current; | |
34 | uint8_t timeout; | |
35 | } timer_t; | |
36 | ||
37 | /* functions */ | |
38 | void timer_init(void); | |
39 | void timer_set(timer_t *t, uint8_t timeout); | |
40 | bool timer_expired(timer_t *t); | |
41 | ||
42 | #endif |