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.