-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.h
More file actions
29 lines (23 loc) · 858 Bytes
/
timer.h
File metadata and controls
29 lines (23 loc) · 858 Bytes
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
#pragma once
#include <stddef.h>
#include <stdbool.h>
#include "include/cart.h"
typedef cart_timer_t timer_t;
typedef cart_timer_repeat_t timer_repeat_t;
typedef cart_timer_interval_t timer_interval_t;
typedef cart_timer_unit_t timer_unit_t;
typedef cart_cb_t timer_cb_t;
#define TIMER_UNIT_SEC CART_TIMER_UNIT_SEC
#define TIMER_UNIT_USEC CART_TIMER_UNIT_USEC
#define TIMER_UNIT_NSEC CART_TIMER_UNIT_NSEC
void timer_accept_timeout(size_t);
timer_cb_t timer_get_cb(size_t);
void timer_delete_all(void);
timer_t timer_new(void);
timer_t timer_add(timer_cb_t, timer_repeat_t, bool, timer_interval_t, timer_unit_t, bool);
bool timer_set_cb(timer_t, timer_cb_t);
bool timer_set_repeat(timer_t, timer_repeat_t);
bool timer_set_interval(timer_t, timer_interval_t, timer_unit_t);
bool timer_pause(timer_t);
bool timer_resume(timer_t);
bool timer_del(timer_t);