Unify SDCard config option across ports, and enable machine.SDCard on stm32#19330
Open
dpgeorge wants to merge 5 commits into
Open
Unify SDCard config option across ports, and enable machine.SDCard on stm32#19330dpgeorge wants to merge 5 commits into
machine.SDCard on stm32#19330dpgeorge wants to merge 5 commits into
Conversation
Similar to other classes in the `machine` module, `SDCard` is now there for a port to use if it enables MICROPY_PY_MACHINE_SDCARD. Signed-off-by: Damien George <damien@micropython.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19330 +/- ##
=======================================
Coverage 98.47% 98.47%
=======================================
Files 176 176
Lines 22845 22845
=======================================
Hits 22497 22497
Misses 348 348 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code size report: |
This is now provided by the common one in `extmod/modmachine.c`. Signed-off-by: Damien George <damien@micropython.org>
To unify this with other ports, and to enable the common `machine.SDCard` entry in `extmod/modmachine.c`. Signed-off-by: Damien George <damien@micropython.org>
To unify this with other ports, and to enable the common `machine.SDCard` entry in `extmod/modmachine.c`. Signed-off-by: Damien George <damien@micropython.org>
This aligns the stm32 port with other ports that have `machine.SDCard`. The same `SDCard` class is used for this and the existing `pyb.SDCard`, and its API matches the standard one. Signed-off-by: Damien George <damien@micropython.org>
4f5110f to
ff70b20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports mimxrt, esp32 and renesas-ra already have
machine.SDCard, but they have their own config option to enable it, and a custom entry in the machine module. This PR unifies those ports so:MICROPY_PY_MACHINE_SDCARDextmod/modmachine.cThen,
machine.SDCardis enabled on the stm32 port. That just aliases to the existingpyb.SDCardclass.Note that the docs already mention
machine.SDCardas being available on the stm32 port.Testing
machine.SDCardentry is still theremachine.SDCardentry is identical to thepyb.SDCardentryTrade-offs and Alternatives
Costs a tiny bit of code size on stm32, but makes it much more portable to access
machine.SDCard.Generative AI
Not used.