MCPcopy Create free account
hub / github.com/SmingHub/Sming / timer_insert

Function timer_insert

Sming/Arch/Host/Components/driver/os_timer.cpp:13–31  ·  view source on GitHub ↗

Called with mutex locked

Source from the content-addressed store, hash-verified

11
12// Called with mutex locked
13void timer_insert(uint32_t expire, os_timer_t* ptimer)
14{
15 os_timer_t* t_prev = nullptr;
16 auto t = timer_list;
17 while(t != nullptr) {
18 if(int(t->timer_expire - expire) > 0) {
19 break;
20 }
21 t_prev = t;
22 t = t->timer_next;
23 }
24 if(t_prev == nullptr) {
25 timer_list = ptimer;
26 } else {
27 t_prev->timer_next = ptimer;
28 }
29 ptimer->timer_next = t;
30 ptimer->timer_expire = expire;
31}
32
33} // namespace
34

Callers 2

os_timer_arm_ticksFunction · 0.70
host_service_timersFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected