drivers/mtd_default: add external declarations for mtd* #19538
Merged
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.
Contribution description
The
mtd_default
module definesMTD_NUMOF
, if not present, based on theMTD_*
defines. These defines are set to the correspondingmtd*
MTD device pointer variables in the board definitions. However, not allmtd*
MTD device pointer variables are always made known by external variable declarations. An example are SD Card Interfaces that are defined via themtd_sdcard_default
module. As a result, it may be necessary for an application usingmtd_default
to declare an external MTD device pointer variablemtd
. To be able to use SD card for testing MTD based application,mtd_default
also declares up to sixmtd*
MTD device pointer variables.Testing procedure
Use any board without SD Card definition and compile
tests/pkg_litllefs
,tests/pkg_litllefs2
ortests/pkg_spiffs
, for example to use a temporary connected SD Card interface.Without this PR, compilation fails due to undeclared
mtd0
variableCompilation works with this PR and the temporary connected SD Card interface can be used with this test applications.
Issues/PRs references