Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
19538: drivers/mtd_default: add external declarations for mtd* r=benpicco a=gschorcht ### Contribution description The `mtd_default` module defines `MTD_NUMOF`, if not present, based on the `MTD_*` defines. These defines are set to the corresponding `mtd*` MTD device pointer variables in the board definitions. However, not all `mtd*` MTD device pointer variables are always made known by external variable declarations. An example are SD Card Interfaces that are defined via the `mtd_sdcard_default` module. As a result, it may be necessary for an application using `mtd_default` to declare an external MTD device pointer variable `mtd`. To be able to use SD card for testing MTD based application, `mtd_default` also declares up to six `mtd*` MTD device pointer variables. ### Testing procedure Use any board without SD Card definition and compile `tests/pkg_litllefs`, `tests/pkg_litllefs2` or `tests/pkg_spiffs`, for example to use a temporary connected SD Card interface. ``` CFLAGS='-DMTD_0=mtd0 -DCONFIG_USE_HARDWARE_MTD' USEMODULE='sdcard_spi mtd_sdcard_default' BOARD=nucleo-f411re make -j8 -C tests/pkg_littlefs ``` Without this PR, compilation fails due to undeclared `mtd0` variable ``` tests/pkg_littlefs/bin/nucleo-f411re/riotbuild/riotbuild.h:2:15: error: 'mtd0' undeclared (first use in this function) 2 | #define MTD_0 mtd0 | ^~~~ ``` Compilation works with this PR and the temporary connected SD Card interface can be used with this test applications. ### Issues/PRs references 19547: pkg/openthread: set event callback before netdev init r=benpicco a=bergzand ### Contribution description When using openthread with the ieee802154_submac module, a hard fault is triggered otherwise because the submac's init function calls the event_handler callback. ### Testing procedure Flash the `examples/openthread` application on the nrf52840dk board. Without this patch the board is stuck in a hard fault loop. With this patch the application starts successfully. ### Issues/PRs references None Co-authored-by: Gunar Schorcht <gunar@schorcht.net> Co-authored-by: Koen Zandberg <koen@bergzand.net>
- Loading branch information