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