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

akashdeepsingh
Posts: 9
Joined: Thu Feb 28, 2019 8:28 pm

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

Postby akashdeepsingh » Sun Mar 10, 2019 11:02 pm

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

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

Postby ESP_igrr » Mon Mar 11, 2019 2:36 am

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.

Who is online

Users browsing this forum: Google [Bot] and 150 guests