Skip to content

Commit

Permalink
boards/calliope-mini: factorize common code
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Oct 27, 2018
1 parent 59b3252 commit b3b0cd9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 34 deletions.
11 changes: 2 additions & 9 deletions boards/calliope-mini/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
# 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
FEATURES_PROVIDED += periph_pwm

# 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
18 changes: 8 additions & 10 deletions boards/calliope-mini/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# 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.usbmodem*)))

# 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
PROGRAMMER ?= fscopy

ifeq (fscopy,$(PROGRAMMER))
export FFLAGS =
export DEBUGGER_FLAGS =

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)
else ifeq (openocd,$(PROGRAMMER))
DEBUG_ADAPTER = jlink
endif

# include nrf51 boards common configuration
include $(RIOTBOARD)/common/nrf51/Makefile.include
16 changes: 1 addition & 15 deletions boards/calliope-mini/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,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
* @{
Expand Down Expand Up @@ -65,11 +56,6 @@ extern "C" {
#define BTN1_MODE GPIO_IN
/** @} */

/**
* @brief Initialize the board, also triggers the CPU initialization
*/
void board_init(void);

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit b3b0cd9

Please sign in to comment.