Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tests/extmod/machine_timer: Fix tests. #15284

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

Closed
wants to merge 1 commit into from

Conversation

agatti
Copy link
Contributor

@agatti agatti commented Jun 14, 2024

machine.Timer requires a timer id in its constructor, which was not passed when building objects.

This PR makes the test pass on an ESP32C3 at least, as it would consistently fail before.

`machine.Timer` requires a timer id in its constructor, which was not
passed when building objects.

Signed-off-by: Alessandro Gatti <[email protected]>
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.42%. Comparing base (d7d77d9) to head (867daaa).
Report is 163 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15284   +/-   ##
=======================================
  Coverage   98.42%   98.42%           
=======================================
  Files         161      161           
  Lines       21204    21204           
=======================================
  Hits        20870    20870           
  Misses        334      334           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpgeorge
Copy link
Member

Unfortunately this now fails on other ports that use extmod/machine_timer.c, eg stm32, which only support -1 as the id (to create a software timer). OTOH, esp32 does not support -1, ie doesn't support software timers.

I think we should introduce a machine.SoftTimer class, like we did with machine.SoftI2C and machine.SoftSPI. But that's out of scope for this PR.

@dpgeorge dpgeorge added the tests Relates to tests/ directory in source label Jun 17, 2024
@dpgeorge
Copy link
Member

Fixed in a different way in 9ba04cc

@dpgeorge dpgeorge closed this Aug 16, 2024
@agatti agatti deleted the extmod-machine-timer-fix branch August 16, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants