contiki-os/contiki — pull request #359 by g-oikonomou (2013-09-16 12:56:31+00:00)
Title: Add a method to stop running trickle timers

This pull request adds a method to stop trickle timers and to determine whether a trickle is actually still running. This is desirable because, on occasion, protocols specify conditions under which a running trickle timer must be stopped.

We achieve this by establishing `trickle_timer_stop()` and `trickle_timer_is_running()` macros. We consider a trickle timer to be stopped when `i_cur == 0`. This works because `i_cur > i_min`. In general terms, `i_min > 0` but in our implementation `i_min >= 2` clock ticks.

With the stop mechanism in place, we now only schedule an interval doubling for running timers.

This is a follow on from the discussion in #342. Thanks to @zwuh for bringing this up and for the input. Please, can you provide some further feedback in terms of whether this achieves what you need ? Thanks.