How can I tell if a High Resolution Timer is active?

Posts: 1
Joined: Mon Feb 22, 2021 11:54 pm

How can I tell if a High Resolution Timer is active?

Postby ClarkMills » Tue Feb 23, 2021 12:20 am

Hi guys.

I'm using the "esp_timer" api for high resolution timers to drive stepper motors from the ESP32.
The thing I'm having issues with is determining whether a periodic timer is still active.
What I'm doing is an inelegant hack that will probably bite me in the bum in time but it seems to work, I was hoping that there's a correct way to tell this.
Actually likewise for the one-shot timers too but I've got a workaround that is legal if kludgy.
I've looked at the API and I could just call esp_time_dump() and parse that but that's probably even less elegant and slower than what I'm currently doing.

Aside: I'm writing a stepper class in C++ while I learn C++. Usual accelerate / decelerate / speed / destination / pins-assign-at-new() stuff. Posix C's my thing on Linux; got my class to drive at speeds / destinations so I'm happy with my progress so far. Next stop is getting acceleration / deceleration shoehorned in there (always fun ;).

Cheers... Clark

Who is online

Users browsing this forum: No registered users and 28 guests