20 lines
440 B
C
20 lines
440 B
C
#include <os_internal.h>
|
|
#include "osint.h"
|
|
int osSetTimer(OSTimer *t, OSTime value, OSTime interval, OSMesgQueue *mq, OSMesg msg)
|
|
{
|
|
OSTime time;
|
|
t->next = NULL;
|
|
t->prev = NULL;
|
|
t->interval = interval;
|
|
if(value != 0) t->value = value;
|
|
else t->value = interval;
|
|
t->mq = mq;
|
|
t->msg = msg;
|
|
time = __osInsertTimer(t);
|
|
if(__osTimerList->next == t) {
|
|
__osSetTimerIntr(time);
|
|
}
|
|
return 0;
|
|
}
|
|
|