Skip to content

Inline ESP::getCycleCount() to make it safe to call from ISRs #3165

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

Merged
merged 3 commits into from
Sep 11, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Attribute IRAM_ATTR ISR-safe function in addition to inlining.
  • Loading branch information
dok-net committed Sep 10, 2019
commit 9f3e75d35285a607f51c510f4b7a6165c7525e31
2 changes: 1 addition & 1 deletion cores/esp32/Esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class EspClass

};

uint32_t EspClass::getCycleCount()
uint32_t IRAM_ATTR EspClass::getCycleCount()
{
uint32_t ccount;
__asm__ __volatile__("esync; rsr %0,ccount":"=a" (ccount));
Expand Down