Page 1 of 1

Hardware Timer

Posted: Sat Sep 08, 2018 3:16 pm
by COM8COM8
Hi,
I'm using esp-idf and would like to create a simple timer with the following properties:
* Should run for 1sec
* Should not generate interrupts
* I will check periodically if the timer has finished
* I'd like to use a hardware timer if possible
* If the timer finished and I check for it I will restart it manually

I've started looking around and tinkering with the example over on GitHub but I was not able to produce anything working.

Does somebody know an example matching my needs?

Re: Hardware Timer

Posted: Sun Sep 09, 2018 3:02 am
by ESP_Sprite
What is your use case? Depending on the need for precision, you may not even need a timer but can just check esp_timer_get_time() and wait until the result is 1e6 higher than when you first checked it.

Re: Hardware Timer

Posted: Sun Sep 09, 2018 7:15 am
by COM8COM8
Yes, using esp_timer_get_time() is a great solution.
Thanks!