/* Safely sample tick timer without the risk of race.  */
static void sample_timer(uint32_t &sec, uint32_t &subsec)
/* Safely sample tick timer without the risk of race.  */
static void sample_timer(uint32_t &sec, uint32_t &subsec)
{
        sec_1st_read = tick_cnt_s;
        lower_cnt = TICK_TIMER_CNT;
        sec_2nd_read = tick_cnt_s;
    } while (sec_1st_read != sec_2nd_read);
    sec = sec_1st_read;
    subsec = lower_cnt;
}