| 1234567891011121314151617181920212223242526272829303132333435 |
- #ifndef __TIMER_Hx__
- #define __TIMER_Hx__
- #include "FreeRTOS.h"
- #include "task.h"
- #include <timers.h>
- typedef void (*timer_fn_t)(void *arg, int last);
- typedef struct {
- TimerHandle_t timer;
- int times;
- int times_max;
- timer_fn_t fn;
- void *arg;
- int inited;
- }timer_handle_t;
- timer_handle_t* x_timer_init(void);
- void x_timer_deinit(timer_handle_t * h);
- int x_timer_start(timer_handle_t *h, int t, int times, timer_fn_t fn, void *arg);
- int x_timer_stop(timer_handle_t* h);
- #endif
|