diff --git a/drivers/include/at86rf2xx.h b/drivers/include/at86rf2xx.h index 4aa99e57e6..d8400007f2 100644 --- a/drivers/include/at86rf2xx.h +++ b/drivers/include/at86rf2xx.h @@ -63,12 +63,18 @@ extern "C" { /* the AT86RF212B has a sub-1GHz radio */ #define AT86RF2XX_MIN_CHANNEL (0) #define AT86RF2XX_MAX_CHANNEL (10) +#ifdef DEFAULT_CHANNEL +#define AT86RF2XX_DEFAULT_CHANNEL (DEFAULT_CHANNEL) +#endif #ifndef AT86RF2XX_DEFAULT_CHANNEL #define AT86RF2XX_DEFAULT_CHANNEL (5) #endif #else #define AT86RF2XX_MIN_CHANNEL (11U) #define AT86RF2XX_MAX_CHANNEL (26U) +#ifdef DEFAULT_CHANNEL +#define AT86RF2XX_DEFAULT_CHANNEL (DEFAULT_CHANNEL) +#endif #ifndef AT86RF2XX_DEFAULT_CHANNEL #define AT86RF2XX_DEFAULT_CHANNEL (26U) #endif diff --git a/drivers/include/kw2xrf.h b/drivers/include/kw2xrf.h index 21cc44c6bc..71ba2856c7 100644 --- a/drivers/include/kw2xrf.h +++ b/drivers/include/kw2xrf.h @@ -65,6 +65,9 @@ extern "C" { /** * @brief Default channel used after initialization */ +#ifdef DEFAULT_CHANNEL +#define KW2XRF_DEFAULT_CHANNEL (DEFAULT_CHANNEL) +#endif #ifndef KW2XRF_DEFAULT_CHANNEL #define KW2XRF_DEFAULT_CHANNEL (26U) #endif diff --git a/drivers/include/xbee.h b/drivers/include/xbee.h index f0ca8a2efd..01769ea71d 100644 --- a/drivers/include/xbee.h +++ b/drivers/include/xbee.h @@ -72,6 +72,9 @@ extern "C" { /** * @brief Default channel used after initialization */ +#ifdef DEFAULT_CHANNEL +#define XBEE_DEFAULT_CHANNEL (DEFAULT_CHANNEL) +#endif #ifndef XBEE_DEFAULT_CHANNEL #define XBEE_DEFAULT_CHANNEL (23U) #endif diff --git a/examples/default/Makefile b/examples/default/Makefile index 091afdbad1..deea217768 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -70,4 +70,8 @@ ifneq (,$(filter msba2,$(BOARD))) USEMODULE += random endif +# Set a custom 802.15.4 channel if needed +DEFAULT_CHANNEL ?= 26 +CFLAGS += -DDEFAULT_CHANNEL=$(DEFAULT_CHANNEL) + include $(RIOTBASE)/Makefile.include diff --git a/examples/gnrc_border_router/Makefile b/examples/gnrc_border_router/Makefile index 28ae846cc4..5897163bd9 100644 --- a/examples/gnrc_border_router/Makefile +++ b/examples/gnrc_border_router/Makefile @@ -42,6 +42,10 @@ USEMODULE += ps # include UHCP client USEMODULE += gnrc_uhcpc +# Set a custom 802.15.4 channel if needed +DEFAULT_CHANNEL ?= 26 +CFLAGS += -DDEFAULT_CHANNEL=$(DEFAULT_CHANNEL) + # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: diff --git a/examples/gnrc_minimal/Makefile b/examples/gnrc_minimal/Makefile index 73fed6e962..a6e798b08a 100644 --- a/examples/gnrc_minimal/Makefile +++ b/examples/gnrc_minimal/Makefile @@ -36,6 +36,10 @@ USEMODULE += gnrc_icmpv6_echo # Use minimal standard PRNG USEMODULE += prng_minstd +# Set a custom 802.15.4 channel if needed +DEFAULT_CHANNEL ?= 26 +CFLAGS += -DDEFAULT_CHANNEL=$(DEFAULT_CHANNEL) + CFLAGS += -DGNRC_PKTBUF_SIZE=512 -DGNRC_IPV6_NETIF_ADDR_NUMOF=4 -DGNRC_IPV6_NC_SIZE=1 # Change this to 0 show compiler invocation lines by default: diff --git a/examples/gnrc_networking/Makefile b/examples/gnrc_networking/Makefile index f5251d1f04..7412b8ff67 100644 --- a/examples/gnrc_networking/Makefile +++ b/examples/gnrc_networking/Makefile @@ -33,6 +33,10 @@ USEMODULE += ps USEMODULE += netstats_l2 USEMODULE += netstats_ipv6 +# Set a custom 802.15.4 channel if needed +DEFAULT_CHANNEL ?= 26 +CFLAGS += -DDEFAULT_CHANNEL=$(DEFAULT_CHANNEL) + # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: diff --git a/examples/microcoap_server/Makefile b/examples/microcoap_server/Makefile index a8e51b5e72..7d1db64b7c 100644 --- a/examples/microcoap_server/Makefile +++ b/examples/microcoap_server/Makefile @@ -33,6 +33,10 @@ CFLAGS += -DMICROCOAP_DEBUG # include this for printing IP addresses USEMODULE += shell_commands +# Set a custom 802.15.4 channel if needed +DEFAULT_CHANNEL ?= 26 +CFLAGS += -DDEFAULT_CHANNEL=$(DEFAULT_CHANNEL) + # Comment this out to disable code in RIOT that does safety checking # which is not needed in a production environment but helps in the # development process: