1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/mtd_default: add external declarations for mtd*

The `mtd_default` module defines `MTD_NUMOF` if not existing based on the `MTD_*` defines which are usually set to the corresponding MTD device pointer variables `mtd*`. However, these MTD device pointer variables are not always made known by external variable declarations. An example are SD Card Interfaces which are defined via the `mtd_sdcard_default` module. As a consequence, an application that uses `mtd_default` has still to be modified. Therefore, `mtd_default` also declares up to 6 `mtd*` MTD device pointer variables.
This commit is contained in:
Gunar Schorcht 2023-04-28 10:43:28 +02:00
parent 718a4513b5
commit 714b3e3384

View File

@ -57,6 +57,31 @@ extern "C" {
#endif /* !defined(MTD_NUMOF) && !DOXYGEN */
#if !DOXYGEN
/**
* @brief Declare `mtd*` according to the number of MTD devices
*/
#if MTD_NUMOF > 0
extern mtd_dev_t *mtd0;
#endif
#if MTD_NUMOF > 1
extern mtd_dev_t *mtd1;
#endif
#if MTD_NUMOF > 2
extern mtd_dev_t *mtd2;
#endif
#if MTD_NUMOF > 3
extern mtd_dev_t *mtd3;
#endif
#if MTD_NUMOF > 4
extern mtd_dev_t *mtd4;
#endif
#if MTD_NUMOF > 5
extern mtd_dev_t *mtd5;
#endif
#endif /* !DOXYGEN */
#if defined(MODULE_MTD_SDCARD_DEFAULT)
extern mtd_sdcard_t mtd_sdcard_dev0;
#endif