diff options
Diffstat (limited to 'users/xulkal/timer_utils.c')
-rw-r--r-- | users/xulkal/timer_utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/users/xulkal/timer_utils.c b/users/xulkal/timer_utils.c new file mode 100644 index 000000000..5f5d9a1eb --- /dev/null +++ b/users/xulkal/timer_utils.c | |||
@@ -0,0 +1,12 @@ | |||
1 | #include "timer_utils.h" | ||
2 | |||
3 | bool timer_expired(uint16_t last) | ||
4 | { | ||
5 | return timer_read() - last < 0x8000; | ||
6 | } | ||
7 | |||
8 | bool timer_expired32(uint32_t last) | ||
9 | { | ||
10 | return timer_read32() - last < 0x80000000; | ||
11 | } | ||
12 | |||