-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
tests: Add machine_spi_rate test. #15543
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
Conversation
dd57737
to
d0d7313
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #15543 +/- ##
=======================================
Coverage 98.43% 98.43%
=======================================
Files 161 161
Lines 21281 21281
=======================================
Hits 20948 20948
Misses 333 333 ☔ View full report in Codecov by Sentry. |
I suggest to print the SPI object (eg something like |
Yeah, I was hoping to avoid the complexity of this but I think it's going to be the way forward. |
d0d7313
to
a23b881
Compare
Updated, re-tested on the implemented ports. |
# | ||
# Implementation is somewhat fiddly and inefficient to avoid dependency on | ||
# 're' module, | ||
s = str(spi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpgeorge I went with str() here rather than the suggestion of printing to StringIO because it seems like this should work everywhere (string constructor calls through to mp_obj_print_helper()
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, that's much simpler!
Based on machine_i2s_rate, allows testing basic SPI functionality and timings. Implemented and confirmed working for rp2, esp32, and pyboard. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I tested on Pico (rp2 port), an ESP32 board, PYBv1.0 and PYBD-SF6. Works well.
a23b881
to
1e98c4c
Compare
Summary
Based on machine_i2s_rate, allows testing basic SPI functionality and timings.
Implemented for rp2, esp32 and pyboard.
Implemented while testing #15523.
Testing
Tested on PyBoard V1.1, RP2 Pico, ESP32, ESP32-S3, ESP32-C3.
This work was funded through GitHub Sponsors.