CTL_TIME_t ctl_current_time;

ctl_current_time holds the current time in ticks. ctl_current_time is incremented by ctl_increment_ticks_from_isr.


For portable programs without race conditions you should not read this variable directly, you should use ctl_get_current_time instead. As this variable is changed by an interrupt, it cannot be read atomically on processors whose word size is less than 32 bits without first disabling interrupts. That said, you can read this variable directly in your interrupt handler as long as interrupts are still disabled.


ctl_current_time is not declared volatile because doing so would cause the internal implementation of CTL to be less efficient. We advise you to use the access function ctl_get_current_time which provides clean and efficient access to the current time.

See Also