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

boards/mcb2388: add default MTD backend

This commit is contained in:
Benjamin Valentin 2020-09-04 00:46:16 +02:00
parent f738ac66d3
commit 00bbacc7e8
3 changed files with 25 additions and 0 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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