vxKernel/include/vhex/timer/call.h

21 lines
469 B
C

#ifndef __VHEX_TIMER_CALL__
# define __VHEX_TIMER_CALL__
#include <vhex/defs/types.h>
/* timer_call_t: Indirect call with up to 4 register arguments */
struct timer_call {
void *function;
uint32_t args[4];
};
typedef struct timer_call timer_call_t;
/* TIMER_CALL(): Build an callback from function and arguments */
#define TIMER_CALL(fct, ...) \
(timer_call_t){ \
.function = (void*)fct, \
.args = { __VA_ARGS__ } \
}
#endif /* __VHEX_TIMER_CALL__ */