diff --git a/boards/microbit/Makefile.dep b/boards/microbit/Makefile.dep index e54ceaf6ecb71770b2727908080e6c9d830d0b04..73cf142b588cec054aa2c7034334209f8859a11b 100644 --- a/boards/microbit/Makefile.dep +++ b/boards/microbit/Makefile.dep @@ -7,6 +7,4 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio endif -ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE))) - USEMODULE += nrfmin -endif +include $(RIOTBOARD)/common/nrf51/Makefile.dep diff --git a/boards/microbit/Makefile.features b/boards/microbit/Makefile.features index 2c53068f05f3486548ea4baeb17da24d425173e4..e8d2c5b39d16a4e922373f0b7e308f0546e8e1af 100644 --- a/boards/microbit/Makefile.features +++ b/boards/microbit/Makefile.features @@ -1,13 +1,6 @@ # Put defined MCU peripherals here (in alphabetical order) -FEATURES_PROVIDED += periph_gpio periph_gpio_irq FEATURES_PROVIDED += periph_i2c -FEATURES_PROVIDED += periph_rtt -FEATURES_PROVIDED += periph_timer FEATURES_PROVIDED += periph_uart -# Various other features (if any) - -# The board MPU family (used for grouping by the CI system) -FEATURES_MCU_GROUP = cortex_m0_1 - -include $(RIOTCPU)/nrf51/Makefile.features +# include common nrf51 based boards features +include $(RIOTBOARD)/common/nrf51/Makefile.features diff --git a/boards/microbit/Makefile.include b/boards/microbit/Makefile.include index 6349546dbdc45eb6d3fad57e828b1d7fe31aaf00..8fb097901bda341a43ed961d9c2238b78cc19d74 100644 --- a/boards/microbit/Makefile.include +++ b/boards/microbit/Makefile.include @@ -1,15 +1,12 @@ # define the used CPU -export CPU = nrf51 export CPU_MODEL = nrf51x22xxab # define the default port depending on the host OS PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk - -# we support flashing through plain fscopy or using JLink +# this board supports flashing through plain fscopy, using JLink or using +# openocd. Default programmer is fscopy PROGRAMMER ?= fscopy ifeq (fscopy,$(PROGRAMMER)) export FFLAGS = @@ -18,9 +15,7 @@ ifeq (fscopy,$(PROGRAMMER)) export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh export DEBUGGER = export DEBUGSERVER = -else ifeq (jlink,$(PROGRAMMER)) - export JLINK_DEVICE := nrf51822 - include $(RIOTMAKE)/tools/jlink.inc.mk -else - $(info ERROR: invalid flash tool specified) endif + +# include nrf51 boards common configuration +include $(RIOTBOARD)/common/nrf51/Makefile.include diff --git a/boards/microbit/include/board.h b/boards/microbit/include/board.h index c2c0d8daa48a874c34668619f6d6777c1e73fb2c..5a4d74755b2c1c279115f69bed67395eadd9a139 100644 --- a/boards/microbit/include/board.h +++ b/boards/microbit/include/board.h @@ -20,21 +20,12 @@ #ifndef BOARD_H #define BOARD_H -#include "cpu.h" -#include "periph_conf.h" +#include "board_common.h" #ifdef __cplusplus extern "C" { #endif -/** - * @name Xtimer configuration - * @{ - */ -#define XTIMER_WIDTH (24) -#define XTIMER_BACKOFF (40) -/** @} */ - /** * @name LED matrix pin configuration * @{ @@ -80,11 +71,6 @@ extern "C" { #define MAG3110_PARAM_ADDR 0x0e /** @} */ -/** - * @brief Initialize the board, also triggers the CPU initialization - */ -void board_init(void); - #ifdef __cplusplus } #endif