diff --git a/boards/mcb2388/Makefile.dep b/boards/mcb2388/Makefile.dep index 0688b61ce6..ea9b31270f 100644 --- a/boards/mcb2388/Makefile.dep +++ b/boards/mcb2388/Makefile.dep @@ -2,3 +2,10 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_adc USEMODULE += saul_gpio endif + +# default to mtd_mci if no other MTD backend is selected +ifneq (,$(filter mtd,$(USEMODULE))) + ifeq (,$(filter mtd_%,$(USEMODULE))) + USEMODULE += mtd_mci + endif +endif diff --git a/boards/mcb2388/board_init.c b/boards/mcb2388/board_init.c index 7ea374ff4e..77b1a0ca14 100644 --- a/boards/mcb2388/board_init.c +++ b/boards/mcb2388/board_init.c @@ -22,9 +22,16 @@ #include "board.h" #include "cpu.h" +#include "mtd.h" #include "periph/init.h" #include "stdio_base.h" +#ifdef MODULE_MTD_MCI +extern const mtd_desc_t mtd_mci_driver; +static mtd_dev_t _mtd_mci = { .driver = &mtd_mci_driver }; +mtd_dev_t *mtd0 = &_mtd_mci; +#endif + void board_init(void) { /* LEDS */ diff --git a/boards/mcb2388/include/board.h b/boards/mcb2388/include/board.h index 6546c0ab6d..96baa5c618 100644 --- a/boards/mcb2388/include/board.h +++ b/boards/mcb2388/include/board.h @@ -20,6 +20,7 @@ #define BOARD_H #include "lpc23xx.h" +#include "mtd.h" #ifdef __cplusplus extern "C" { @@ -104,6 +105,16 @@ extern "C" { GPIO_UNDEF, GPIO_UNDEF } /** @} */ +/** + * @name MTD configuration + * @{ + */ +#ifdef MODULE_MTD_MCI +extern mtd_dev_t *mtd0; +#define MTD_0 mtd0 +#endif +/** @} */ + #ifdef __cplusplus } #endif