mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
timer: get_timer_ticks and some more changes
This commit is contained in:
@@ -17,23 +17,25 @@ typedef struct timerentry_t {
|
||||
bool fired;
|
||||
} timerentry_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct timer_t {
|
||||
spinlock_t lock;
|
||||
time_t tick_limit;
|
||||
time_t ticksperus;
|
||||
time_t tickcurrent;
|
||||
time_t current_target;
|
||||
bool running;
|
||||
void (*arm)(time_t);
|
||||
time_t (*stop)();
|
||||
void (*arm)(struct timer_t *, time_t);
|
||||
time_t (*stop)(struct timer_t *);
|
||||
time_t (*time_passed)(struct timer_t *);
|
||||
timerentry_t *queue;
|
||||
} timer_t;
|
||||
|
||||
time_t timer_get_ticks(timer_t *timer);
|
||||
void timer_resume(timer_t *timer);
|
||||
void timer_stop(timer_t *timer);
|
||||
void timer_isr(timer_t *timer, context_t *context);
|
||||
void timer_insert(timer_t *timer, timerentry_t *entry, dpcfn_t fn, dpcarg_t arg, time_t us, bool repeating);
|
||||
uintmax_t timer_remove(timer_t *timer, timerentry_t *entry);
|
||||
timer_t *timer_new(time_t ticksperus, void (*arm)(time_t), time_t (*stop)(), time_t tick_limit);
|
||||
time_t timer_remove(timer_t *timer, timerentry_t *entry);
|
||||
timer_t *timer_new(time_t ticksperus, void (*arm)(timer_t *, time_t), time_t (*stop)(timer_t *), time_t (*time_passed)(timer_t *), time_t tick_limit);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user