-
Notifications
You must be signed in to change notification settings - Fork 7.6k
timerReadMicros returns older value #4160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
duplicate of #3434. There needs to be a small delay inside timerRead(), you can try |
also if you just need an incremental timestamp you can call |
Hi @atanisoft, I wouldn't go for updating the library code and adding delay after update. Not sure why a delay is required, isn't it preventing us from full control on hardware timers? e.g. If I am using timerRead with scaling less than 80 than I can get resolution of less than 1 microseconds.. But putting delay will make it hard. Anyways thanks for second suggestion, for now I read resolution in microseconds so will give it a try. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ESP32 Dev Module
IDE name: Arduino IDE
Upload Speed: 115200
Computer OS: Windows 10
Description:
I am working on an application where I have GPIO interrupt defined, and on each interrupt I want to record timer value for which I am calling
timerReadMicros
but the problem I am facing istimerReadMicros
always return older time when it was last called, and if I call it second time it seems to be close to real value. It looks liketimerReadMicros
is storing and returning older values. I have triedtimerRead
,timerReadSeconds
. Every function have same behavior. Following is the code snippetif I change the code like this
timer configuration is like this
I assume I am missing something very basic here.
Any help is really appreciated.
The text was updated successfully, but these errors were encountered: