We have a timer with a number of variably sized intervals as illustrated below operating on a single capture/compare channel (CC):
|-----------|-----|-----------------|--|----------| Start A B C D E
Currently the method we use to set the next time interval (i.e. Start->A, A->B, etc), assuming the previous interrupt is already processed, is the following:
uint32_t now, next_interval; ... next_interval = <some_amount> ... now = nrfx_timer_capture_get( &timer, NRF_TIMER_CC_CHANNEL0 ); nrfx_timer_compare( &timer, NRF_TIMER_CC_CHANNEL1, now + next_interval, true );
What we would like to do is omit the step (even implicitly) of performing a capture and instead setting the compare to the future by X amount of ticks. Is there a mode or way of doing this?
As a side/bonus question are the "best practices" way of updating a timer different from the above example, and if so what are the best practices?
Many Thanks