From 58983de28afbdf5ec6afcb66d88690390c5ded10 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 2 Nov 2016 11:08:10 +0100 Subject: [PATCH] examples/gnrc_networking: fix custom channel definition --- examples/default/Makefile | 6 +++--- examples/gnrc_border_router/Makefile | 6 +++--- examples/gnrc_minimal/Makefile | 6 +++--- examples/gnrc_networking/Makefile | 18 ++++++++++++++---- examples/microcoap_server/Makefile | 6 +++--- examples/nanocoap_server/Makefile | 18 ++++++++++++++---- 6 files changed, 40 insertions(+), 20 deletions(-) diff --git a/examples/default/Makefile b/examples/default/Makefile index 5d0f9788a5..ad50732db9 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -72,14 +72,14 @@ endif include $(RIOTBASE)/Makefile.include # Set a custom channel if needed -ifeq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz +ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz DEFAULT_CHANNEL ?= 0 CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) else - ifeq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz + ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz DEFAULT_CHANNEL ?= 5 CFLAGS += -DIEEE802154_DEFAULT_SUBGHZ_CHANNEL=$(DEFAULT_CHANNEL) - else # radio is IEEE 802.15.4 2.4 GHz + else # radio is IEEE 802.15.4 2.4 GHz DEFAULT_CHANNEL ?= 26 CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) endif diff --git a/examples/gnrc_border_router/Makefile b/examples/gnrc_border_router/Makefile index 7f87a85cba..940f00d1e7 100644 --- a/examples/gnrc_border_router/Makefile +++ b/examples/gnrc_border_router/Makefile @@ -64,14 +64,14 @@ host-tools: $(AD)env -u CC -u CFLAGS make -C $(RIOTBASE)/dist/tools # Set a custom channel if needed -ifeq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz +ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz DEFAULT_CHANNEL ?= 0 CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) else - ifeq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz + ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz DEFAULT_CHANNEL ?= 5 CFLAGS += -DIEEE802154_DEFAULT_SUBGHZ_CHANNEL=$(DEFAULT_CHANNEL) - else # radio is IEEE 802.15.4 2.4 GHz + else # radio is IEEE 802.15.4 2.4 GHz DEFAULT_CHANNEL ?= 26 CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) endif diff --git a/examples/gnrc_minimal/Makefile b/examples/gnrc_minimal/Makefile index 10945a0e10..173aa163ee 100644 --- a/examples/gnrc_minimal/Makefile +++ b/examples/gnrc_minimal/Makefile @@ -44,14 +44,14 @@ QUIET ?= 1 include $(RIOTBASE)/Makefile.include # Set a custom channel if needed -ifeq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz +ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz DEFAULT_CHANNEL ?= 0 CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) else - ifeq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz + ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz DEFAULT_CHANNEL ?= 5 CFLAGS += -DIEEE802154_DEFAULT_SUBGHZ_CHANNEL=$(DEFAULT_CHANNEL) - else # radio is IEEE 802.15.4 2.4 GHz + else # radio is IEEE 802.15.4 2.4 GHz DEFAULT_CHANNEL ?= 26 CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) endif diff --git a/examples/gnrc_networking/Makefile b/examples/gnrc_networking/Makefile index 2c8157c3ae..4b8488cd4b 100644 --- a/examples/gnrc_networking/Makefile +++ b/examples/gnrc_networking/Makefile @@ -34,10 +34,6 @@ USEMODULE += netstats_l2 USEMODULE += netstats_ipv6 USEMODULE += netstats_rpl -# 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: @@ -51,3 +47,17 @@ CFLAGS += -DDEVELHELP QUIET ?= 1 include $(RIOTBASE)/Makefile.include + +# Set a custom channel if needed +ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz + DEFAULT_CHANNEL ?= 0 + CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) +else + ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz + DEFAULT_CHANNEL ?= 5 + FLAGS += -DIEEE802154_DEFAULT_SUBGHZ_CHANNEL=$(DEFAULT_CHANNEL) + else # radio is IEEE 802.15.4 2.4 GHz + DEFAULT_CHANNEL ?= 26 + CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) + endif +endif diff --git a/examples/microcoap_server/Makefile b/examples/microcoap_server/Makefile index 221f271bf1..615ce03be5 100644 --- a/examples/microcoap_server/Makefile +++ b/examples/microcoap_server/Makefile @@ -58,14 +58,14 @@ QUIET ?= 1 include $(RIOTBASE)/Makefile.include # Set a custom channel if needed -ifeq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz +ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz DEFAULT_CHANNEL ?= 0 CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) else - ifeq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz + ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz DEFAULT_CHANNEL ?= 5 CFLAGS += -DIEEE802154_DEFAULT_SUBGHZ_CHANNEL=$(DEFAULT_CHANNEL) - else # radio is IEEE 802.15.4 2.4 GHz + else # radio is IEEE 802.15.4 2.4 GHz DEFAULT_CHANNEL ?= 26 CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) endif diff --git a/examples/nanocoap_server/Makefile b/examples/nanocoap_server/Makefile index ce5d515c6e..e8fc493a45 100644 --- a/examples/nanocoap_server/Makefile +++ b/examples/nanocoap_server/Makefile @@ -37,10 +37,6 @@ USEPKG += nanocoap # 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: @@ -64,3 +60,17 @@ endif QUIET ?= 1 include $(RIOTBASE)/Makefile.include + +# Set a custom channel if needed +ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz + DEFAULT_CHANNEL ?= 0 + CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) +else + ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz + DEFAULT_CHANNEL ?= 5 + CFLAGS += -DIEEE802154_DEFAULT_SUBGHZ_CHANNEL=$(DEFAULT_CHANNEL) + else # radio is IEEE 802.15.4 2.4 GHz + DEFAULT_CHANNEL ?= 26 + CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) + endif +endif