MCPcopy Create free account
hub / github.com/ARMmbed/DAPLink / TimerInsert

Function TimerInsert

source/rtos2/RTX/Source/rtx_timer.c:42–64  ·  view source on GitHub ↗

Insert Timer into the Timer List sorted by Time. \param[in] timer timer object. \param[in] tick timer tick.

Source from the content-addressed store, hash-verified

40/// \param[in] timer timer object.
41/// \param[in] tick timer tick.
42static void TimerInsert (os_timer_t *timer, uint32_t tick) {
43 os_timer_t *prev, *next;
44
45 prev = NULL;
46 next = osRtxInfo.timer.list;
47 while ((next != NULL) && (next->tick <= tick)) {
48 tick -= next->tick;
49 prev = next;
50 next = next->next;
51 }
52 timer->tick = tick;
53 timer->prev = prev;
54 timer->next = next;
55 if (next != NULL) {
56 next->tick -= timer->tick;
57 next->prev = timer;
58 }
59 if (prev != NULL) {
60 prev->next = timer;
61 } else {
62 osRtxInfo.timer.list = timer;
63 }
64}
65
66/// Remove Timer from the Timer List.
67/// \param[in] timer timer object.

Callers 2

osRtxTimerTickFunction · 0.85
svcRtxTimerStartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected