Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards: remove extern mtd_dev_t *mtd<n> declarations from board definitions #20104

Merged
merged 7 commits into from
Dec 7, 2023
9 changes: 3 additions & 6 deletions boards/adafruit-grand-central-m4-express/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -66,12 +65,10 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0; /**< Flash MTD device pointer */
#define MTD_0 mtd0 /**< Flash MTD device */
extern mtd_dev_t *mtd1; /**< MTD device pointer for SD Card */
#define MTD_1 mtd1 /**< MTD device for SD Card */
#define MTD_0 mtd_dev_get(0) /**< MTD device for the 8 MByte QSPI Flash */
#define MTD_1 mtd_dev_get(1) /**< MTD device for the SD Card */

#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1 /**< mtd1 is used for SD Card */
#define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1 /**< MTD_1 is used for SD Card */
/** @} */

/**
Expand Down
4 changes: 1 addition & 3 deletions boards/adafruit-itsybitsy-m4/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -53,8 +52,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
/** @} */

/**
Expand Down
4 changes: 1 addition & 3 deletions boards/adafruit-pybadge/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"
#include "periph/gpio.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -59,8 +58,8 @@
#define BACKLIGHT_PIN GPIO_PIN(PA, 1) /**< Backlight pin */
#define BACKLIGHT_PORT PORT->Group[PA] /**< Backlight pin port */
#define BACKLIGHT_MASK (1 << 1) /**< Backlight pin mask */
#define BACKLIGHT_ON (BACKLIGHT_PORT.OUTSET.reg = BACKLIGHT_MASK) /**< Turn backlight on */

Check warning on line 61 in boards/adafruit-pybadge/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#define BACKLIGHT_OFF (BACKLIGHT_PORT.OUTCLR.reg = BACKLIGHT_MASK) /**< Turn backlight off */

Check warning on line 62 in boards/adafruit-pybadge/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
/** @} */

/**
Expand All @@ -73,7 +72,7 @@
#define ST77XX_PARAM_DCX GPIO_PIN(PB, 5) /**< DCX pin */
#define ST77XX_PARAM_RST GPIO_PIN(PA, 0) /**< Reset pin */
#define ST77XX_PARAM_NUM_LINES (160U) /**< Number of screen lines */
#define ST77XX_PARAM_RGB_CHANNELS (128U) /**< Number of screen rgb channel (height) */

Check warning on line 75 in boards/adafruit-pybadge/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#define ST77XX_PARAM_RGB (1) /**< RGB configuration */
#define ST77XX_PARAM_INVERTED (0) /**< Inversion configuration */
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_90 /**< Rotation mode */
Expand All @@ -85,7 +84,7 @@
* @name Neopixel LEDs (not supported yet)
* @{
*/
#define WS281X_PARAM_PIN (GPIO_PIN(PA, 15)) /**< GPIO pin connected to the data pin of the first LED */

Check warning on line 87 in boards/adafruit-pybadge/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#define WS281X_PARAM_NUMOF (5U) /**< Number of LEDs chained */
/** @} */

Expand All @@ -101,8 +100,7 @@
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0; /**< pointer to mtd0 */
#define MTD_0 mtd0 /**< mtd0 constant */
#define MTD_0 mtd_dev_get(0) /**< MTD_0 constant */
/** @} */

/**
Expand Down
12 changes: 2 additions & 10 deletions boards/common/esp32x/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
#include "periph/gpio.h"
#include "sdkconfig.h"

#if MODULE_MTD
#include "mtd.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -103,14 +99,10 @@ extern "C" {
#define SPI_FLASH_DRIVE_START 0
#endif

#define MTD_0 mtd0 /**< Flash MTD device */
extern mtd_dev_t *mtd0; /**< Flash MTD device pointer */
#define MTD_0 mtd_dev_get(0) /**< MTD device for the internal Flash */

#if MODULE_MTD_SDCARD_DEFAULT || DOXYGEN

#define MTD_1 mtd1 /**< SD Card MTD device */
extern mtd_dev_t *mtd1; /**< SD Card MTD device pointer */

#define MTD_1 mtd_dev_get(1) /**< MTD device for the SD Card */
#endif /* MODULE_MTD_SDCARD_DEFAULT || DOXYGEN */

/**
Expand Down
6 changes: 1 addition & 5 deletions boards/common/esp8266/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,9 @@ extern "C" {
* a system MTD device has to be defined.
* @{
*/
#include "mtd.h"

/** Default MTD device definition */
#define MTD_0 mtd0

/** Pointer to the default MTD device structure */
extern mtd_dev_t *mtd0;
#define MTD_0 mtd_dev_get(0)

/**
* @brief MTD offset for SD Card interfaces
Expand Down
4 changes: 1 addition & 3 deletions boards/common/weact-f4x1cx/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
extern "C" {
#endif

#include "mtd.h"
#include "periph_cpu.h"

/**
Expand Down Expand Up @@ -73,8 +72,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
/** @} */

#ifdef __cplusplus
Expand Down
5 changes: 1 addition & 4 deletions boards/ikea-tradfri/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include "periph/gpio.h"
#include "periph/spi.h"

#include "mtd.h"

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -100,8 +98,7 @@ extern "C" {
* @name MTD configuration
*/
/** @{ */
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
/** @} */

#ifdef __cplusplus
Expand Down
4 changes: 1 addition & 3 deletions boards/iotlab-m3/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "cpu.h"
#include "periph_conf.h"
#include "board_common.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -70,8 +69,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0; /**< SPI NOR Flash device */
#define MTD_0 mtd0 /**< Indicate presence of MTD device */
#define MTD_0 mtd_dev_get(0) /**< SPI NOR Flash device */
/** @} */

#ifdef __cplusplus
Expand Down
4 changes: 1 addition & 3 deletions boards/mcb2388/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BOARD_H

#include "lpc23xx.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -110,8 +109,7 @@ extern "C" {
* @{
*/
#ifdef MODULE_MTD_MCI
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
#endif
/** @} */

Expand Down
4 changes: 1 addition & 3 deletions boards/msba2/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BOARD_H

#include "lpc23xx.h"
#include "mtd.h"
#include "bitarithm.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -51,8 +50,7 @@ extern "C" {
* @{
*/
#ifdef MODULE_MTD_MCI
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
#endif
/** @} */

Expand Down
4 changes: 1 addition & 3 deletions boards/mulle/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "cpu.h"
#include "periph_conf.h"
#include "mulle-nvram.h"
#include "mtd.h"

/* Use the on board RTC 32kHz clock for LPTMR clocking. */
#undef LPTIMER_CLKSRC
Expand Down Expand Up @@ -150,8 +149,7 @@ extern "C" {
* @name MTD configuration
*/
/** @{ */
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
/** @} */

/**
Expand Down
11 changes: 2 additions & 9 deletions boards/native/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
extern "C" {
#endif

#ifdef MODULE_MTD
#include "mtd_native.h"
#endif

/**
* @name LED handlers
* @{
Expand Down Expand Up @@ -90,11 +86,8 @@ void _native_LED_RED_TOGGLE(void);
#endif
/** @} */

/** Default MTD device */
#define MTD_0 mtd0

/** mtd flash emulation device */
extern mtd_dev_t *mtd0;
/** Default MTD device (mtd flash emulation device) */
#define MTD_0 mtd_dev_get(0)
#endif

/**
Expand Down
6 changes: 1 addition & 5 deletions boards/nrf52840dk/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define BOARD_H

#include "board_common.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -77,10 +76,7 @@ extern "C" {
/** @} */

/** Default MTD device */
#define MTD_0 mtd0

/** mtd flash emulation device */
extern mtd_dev_t *mtd0;
#define MTD_0 mtd_dev_get(0)

/**
* @name Button pin configuration
Expand Down
4 changes: 1 addition & 3 deletions boards/nrf5340dk-app/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -100,8 +99,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)

#define BOARD_QSPI_PIN_CS GPIO_PIN(0, 18) /**< SPI Flash Chip Select */
#define BOARD_QSPI_PIN_WP GPIO_PIN(0, 15) /**< SPI Flash Write Protect */
Expand Down
4 changes: 1 addition & 3 deletions boards/pinetime/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include "cpu.h"
#include "board_common.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -97,8 +96,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
/** @} */

/**
Expand Down
4 changes: 1 addition & 3 deletions boards/qn9080dk/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"
#include "periph_conf.h"
#include "periph_cpu.h"

Expand Down Expand Up @@ -63,8 +62,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0;
#define MTD_0 mtd0
#define MTD_0 mtd_dev_get(0)
/** @} */

#ifdef __cplusplus
Expand Down
6 changes: 1 addition & 5 deletions boards/remote-revb/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"
#include "board_common.h"

#ifdef __cplusplus
Expand Down Expand Up @@ -124,10 +123,7 @@
/** @} */

/** Default MTD device */
#define MTD_0 mtd0

/** mtd flash emulation device */
extern mtd_dev_t *mtd0;
#define MTD_0 mtd_dev_get(0)

#ifdef __cplusplus
} /* end extern "C" */
Expand Down
10 changes: 4 additions & 6 deletions boards/same54-xpro/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -71,12 +70,11 @@ extern "C" {
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0, *mtd1, *mtd2;
#define MTD_0 mtd0
#define MTD_1 mtd1
#define MTD_2 mtd2
#define MTD_0 mtd_dev_get(0) /**< MTD device for the QSPI Flash */
#define MTD_1 mtd_dev_get(1) /**< MTD device for the AT24MAC402 serial EEPROM */
#define MTD_2 mtd_dev_get(2) /**< MTD device for the SD/MMC Card */

#define CONFIG_SDMMC_GENERIC_MTD_OFFSET 2 /**< mtd2 is used for SD Card */
#define CONFIG_SDMMC_GENERIC_MTD_OFFSET 2 /**< MTD_2 is used for the SD Card */
/** @} */

/**
Expand Down
4 changes: 1 addition & 3 deletions boards/samr34-xpro/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define BOARD_H

#include "cpu.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -45,7 +44,7 @@
* @name Board specific configuration
* @{
*/
#define TCXO_PWR_PIN GPIO_PIN(PA, 9) /**< 32 MHz oscillator for radio enable */

Check warning on line 47 in boards/samr34-xpro/include/board.h

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
#define TX_OUTPUT_SEL_PIN GPIO_PIN(PA, 13) /**< BAND_SEL */
/** @}*/

Expand Down Expand Up @@ -80,8 +79,7 @@
* @name MTD configuration
* @{
*/
extern mtd_dev_t *mtd0; /**< First memory type device */
#define MTD_0 mtd0 /**< First memory type device */
#define MTD_0 mtd_dev_get(0) /**< First memory type device */
/** @} */

#ifdef __cplusplus
Expand Down
4 changes: 1 addition & 3 deletions boards/seeedstudio-gd32/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#define BOARD_H

#include "board_common.h"
#include "mtd.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -72,8 +71,7 @@ extern "C" {
* @name MTD configuration
* @{
*/
#define MTD_0 mtd0 /**< MTD device for SD Card */
extern mtd_dev_t *mtd0; /**< MTD device pointer for SD Card */
#define MTD_0 mtd_dev_get(0) /**< MTD device for the SD Card */
/** @} */

/**
Expand Down
Loading
Loading