diff --git a/boards/common/esp32/include/board_common.h b/boards/common/esp32/include/board_common.h index 3b5143eb5961..a81ffd7c2f03 100644 --- a/boards/common/esp32/include/board_common.h +++ b/boards/common/esp32/include/board_common.h @@ -35,8 +35,12 @@ #include "periph/gpio.h" #include "sdk_conf.h" +#if MODULE_MTD +#include "mtd.h" +#endif + #ifdef __cplusplus - extern "C" { +extern "C" { #endif /** @@ -103,7 +107,6 @@ * Built-in SPI flash memory is used as MTD system drive. * @{ */ -#include "mtd.h" /** * @brief MTD drive start address in SPI flash memory diff --git a/cpu/esp32/include/sdk_conf.h b/cpu/esp32/include/sdk_conf.h index 2e5fecbb3e19..5f417be778cc 100644 --- a/cpu/esp32/include/sdk_conf.h +++ b/cpu/esp32/include/sdk_conf.h @@ -24,12 +24,12 @@ #ifndef DOXYGEN +#include "board.h" + #ifdef __cplusplus extern "C" { #endif -#include "board.h" - /** * @brief Defines the CPU frequency [values = 2, 40, 80, 160 and 240] */