forked from haraldwolff/avr-fw-modules
16 lines
323 B
C
Executable File
16 lines
323 B
C
Executable File
#include <sys/timer.h>
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
SYSTIMER* timer_create(uint32_t id,uint32_t timeout){
|
|
SYSTIMER* timer = (SYSTIMER*)malloc(sizeof(SYSTIMER));
|
|
if (timer){
|
|
memset(timer,0x00,sizeof(SYSTIMER));
|
|
list_init( &timer->list );
|
|
timer->id = id;
|
|
timer->elapse = timeout;
|
|
};
|
|
return timer;
|
|
};
|