Skip to content
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

[clock] Fix multicore us clock reading on RP2040 #1010

Merged
merged 2 commits into from
May 3, 2023

Conversation

salkinium
Copy link
Member

@salkinium salkinium commented May 1, 2023

When using the microsecond clock from both Core0 and Core1, the interrupt semaphore was accessed by both, which broke the overflow detection and caused jitters of up to 1ms.
This gives each core its own flag.

  • Implement fix
  • Test fix
  • Add 64-bit timer as alternative too much effort, cannot be bothered
  • Add examples

Fixes #907. cc @cocasema

@salkinium salkinium added this to the 2023q2 milestone May 1, 2023
@salkinium salkinium marked this pull request as ready for review May 1, 2023 19:29
@salkinium
Copy link
Member Author

Can you check if this also fixes your Problem, @cocasema?

@cocasema
Copy link

cocasema commented May 3, 2023

Can you check if this also fixes your Problem, @cocasema?

Ran the example till loop: 13647, no ERRORs reported. ✔️

@salkinium salkinium merged commit 389a9c3 into modm-io:develop May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

RP2040 modm::chrono::micro_clock::now() is imprecise when called from Core1
2 participants