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

Skip to content

esp32: Fix I2S init error handling, add test coverage. #15541

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 2 commits into from
Aug 2, 2024

Conversation

projectgus
Copy link
Contributor

Summary

  • Fix I2S initialisation when requested DMA buffer size is small (driver always needs 2 buffers).
  • Fixes silent failure during I2S init, will now raise an exception if initialisation fails.
  • Adds support for ESP32 in the extmod/machine_i2s_rate test.

Found while testing #15523.

Testing

With these changes machine_i2s_rate test now passes on esp32.

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.43%. Comparing base (e1ecc23) to head (dd5e2f9).
Report is 6 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15541   +/-   ##
=======================================
  Coverage   98.43%   98.43%           
=======================================
  Files         161      161           
  Lines       21275    21277    +2     
=======================================
+ Hits        20942    20944    +2     
  Misses        333      333           

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

ESP-IDF driver always requires at least two DMA buffers, so ensure that's
the case.

Failures during initialisation were being lost because ESP_ERROR_CHECK is
configured as a no-op, so the failure was deferred until read() or write()
was called on the port.  Raise an error from init, instead.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
@dpgeorge dpgeorge merged commit 6d05424 into micropython:master Aug 2, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants