1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

boards/common/nrf51: add alternative xtimer mapping

This commit is contained in:
Hauke Petersen 2019-06-04 12:45:02 +02:00 committed by Alexandre Abadie
parent 701ba9c608
commit c9e5d2ccc4
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 18 additions and 0 deletions

View File

@ -7,6 +7,11 @@ include $(RIOTMAKE)/tools/serial.inc.mk
# include common nrf51 headers # include common nrf51 headers
INCLUDES += -I$(RIOTBOARD)/common/nrf51/include INCLUDES += -I$(RIOTBOARD)/common/nrf51/include
# use alternative xtimer mapping if applicable
ifneq (,$(filter nimble,$(USEPKG)))
CFLAGS += -DBOARD_NRF51_XTIMER_ALT
endif
ifeq ($(PROGRAMMER),openocd) ifeq ($(PROGRAMMER),openocd)
# use common openocd configuration for nrf51 # use common openocd configuration for nrf51
export OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf51/dist/openocd.cfg export OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf51/dist/openocd.cfg

View File

@ -31,9 +31,22 @@ extern "C" {
/** /**
* @name Xtimer configuration * @name Xtimer configuration
*
* Some external packages (e.g. NimBLE) require dedicated access to timer 0.
* Setting the BOARD_NRF51_XTIMER_ALT variable allows to change the default
* xtimer configuration to use
*
* @{ * @{
*/ */
#ifndef BOARD_NRF51_XTIMER_ALT
/* default xtimer mapping */
#define XTIMER_WIDTH (24) #define XTIMER_WIDTH (24)
#else
/* alternative mapping to TIMER_DEV(1) */
#define XTIMER_DEV TIMER_DEV(1)
#define XTIMER_WIDTH (16)
#define XTIMER_CHAN (0)
#endif
#define XTIMER_BACKOFF (40) #define XTIMER_BACKOFF (40)
/** @} */ /** @} */