Skip to content
Jérémie Magnette edited this page Dec 21, 2015 · 1 revision

The init function pico_stack_init is also responsible of initializing the timer API. The global binary heap Timers gets initialized via heap_init, so that the timer API can be used by the modules right after pico_stack_init returns.
Adding a new timer means associating a callback to a deadline via the pico_timer_add function, that is globally available. When the timer expires, picoTCP executes the callback from the pico_stack_tick context.
Disabling a timer is possible using the pico_timer_cancel function, but abusing this feature could result in a large number of objects in the binary heap, as the disabled timer is not removed from the heap until its originally scheduled deadline, for performance reasons.

Clone this wiki locally