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:
parent
701ba9c608
commit
c9e5d2ccc4
@ -7,6 +7,11 @@ include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
# include common nrf51 headers
|
||||
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)
|
||||
# use common openocd configuration for nrf51
|
||||
export OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf51/dist/openocd.cfg
|
||||
|
@ -31,9 +31,22 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @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)
|
||||
#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)
|
||||
/** @} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user