Lines Matching refs:obj

58 static void TimerInsertNewHeadTimer( TimerEvent_t *obj );
69 static void TimerInsertTimer( TimerEvent_t *obj );
76 static void TimerSetTimeout( TimerEvent_t *obj );
84 static bool TimerExists( TimerEvent_t *obj );
86 void TimerInit( TimerEvent_t *obj, void ( *callback )( void *context ) ) in TimerInit() argument
88 obj->Timestamp = 0; in TimerInit()
89 obj->ReloadValue = 0; in TimerInit()
90 obj->IsStarted = false; in TimerInit()
91 obj->IsNext2Expire = false; in TimerInit()
92 obj->Callback = callback; in TimerInit()
93 obj->Context = NULL; in TimerInit()
94 obj->Next = NULL; in TimerInit()
97 void TimerSetContext( TimerEvent_t *obj, void* context ) in TimerSetContext() argument
99 obj->Context = context; in TimerSetContext()
102 void TimerStart( TimerEvent_t *obj ) in TimerStart() argument
108 if( ( obj == NULL ) || ( TimerExists( obj ) == true ) ) in TimerStart()
114 obj->Timestamp = obj->ReloadValue; in TimerStart()
115 obj->IsStarted = true; in TimerStart()
116 obj->IsNext2Expire = false; in TimerStart()
122 TimerInsertNewHeadTimer( obj ); in TimerStart()
127 obj->Timestamp += elapsedTime; in TimerStart()
129 if( obj->Timestamp < TimerListHead->Timestamp ) in TimerStart()
131 TimerInsertNewHeadTimer( obj ); in TimerStart()
135 TimerInsertTimer( obj ); in TimerStart()
141 static void TimerInsertTimer( TimerEvent_t *obj ) in TimerInsertTimer() argument
148 if( obj->Timestamp > next->Timestamp ) in TimerInsertTimer()
155 cur->Next = obj; in TimerInsertTimer()
156 obj->Next = next; in TimerInsertTimer()
160 cur->Next = obj; in TimerInsertTimer()
161 obj->Next = NULL; in TimerInsertTimer()
164 static void TimerInsertNewHeadTimer( TimerEvent_t *obj ) in TimerInsertNewHeadTimer() argument
173 obj->Next = cur; in TimerInsertNewHeadTimer()
174 TimerListHead = obj; in TimerInsertNewHeadTimer()
178 bool TimerIsStarted( TimerEvent_t *obj ) in TimerIsStarted() argument
180 return obj->IsStarted; in TimerIsStarted()
235 void TimerStop( TimerEvent_t *obj ) in TimerStop() argument
243 if( ( TimerListHead == NULL ) || ( obj == NULL ) ) in TimerStop()
249 obj->IsStarted = false; in TimerStop()
251 if( TimerListHead == obj ) // Stop the Head in TimerStop()
283 if( cur == obj ) in TimerStop()
307 static bool TimerExists( TimerEvent_t *obj ) in TimerExists() argument
313 if( cur == obj ) in TimerExists()
322 void TimerReset( TimerEvent_t *obj ) in TimerReset() argument
324 TimerStop( obj ); in TimerReset()
325 TimerStart( obj ); in TimerReset()
328 void TimerSetValue( TimerEvent_t *obj, uint32_t value ) in TimerSetValue() argument
333 TimerStop( obj ); in TimerSetValue()
342 obj->Timestamp = ticks; in TimerSetValue()
343 obj->ReloadValue = ticks; in TimerSetValue()
365 static void TimerSetTimeout( TimerEvent_t *obj ) in TimerSetTimeout() argument
368 obj->IsNext2Expire = true; in TimerSetTimeout()
371 if( obj->Timestamp < ( RtcGetTimerElapsedTime( ) + minTicks ) ) in TimerSetTimeout()
373 obj->Timestamp = RtcGetTimerElapsedTime( ) + minTicks; in TimerSetTimeout()
375 RtcSetAlarm( obj->Timestamp ); in TimerSetTimeout()