Page 1 of 1

Meaning of TG[group_num]->hw_timer[timer_num].update = 1

Posted: Sun Mar 10, 2019 11:02 pm
by akashdeepsingh
Can someone explain what this line of code does:

Code: Select all

TG[group_num]->hw_timer[timer_num].update = 1;
It is a part of the timer_get_counter_value() function here: https://github.com/espressif/esp-idf/bl ... er/timer.c

Re: Meaning of TG[group_num]->hw_timer[timer_num].update = 1

Posted: Mon Mar 11, 2019 2:36 am
by ESP_igrr
When 1 is written to this field, contents of the 64 bit counter are copied into cnt_high and cnt_low registers. Then you can read these registers and combine them into a 64-bit variable. You can think of this as a way to read two 32-bit values at the same cycle.