Code: Select all
timer_config_t tconf;
tconf.alarm_en = false;
tconf.auto_reload = false;
tconf.counter_dir = TIMER_COUNT_UP;
tconf.counter_en = true;
tconf.divider = 1;
timer_init(TIMER_GROUP_1, TIMER_0, &tconf);
timer_set_counter_value(TIMER_GROUP_1, TIMER_0, 0);
timer_start(TIMER_GROUP_1, TIMER_0);
Code: Select all
uint64_t value;
timer_get_counter_value(TIMER_GROUP_1, TIMER_0, &value);
uint64_t t = value / (TIMER_BASE_CLK / 1000);
Thanks for any help,
Tom