1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefiles: Refactored channel configuration

The default channel configuration is managed within the Makefiles of many
examples and tests. This commit moves the default channel logic to
`makefiles/default-channel.ink.mk` to ease maintenance. All Makefiles that
previously managed the default channel configuration themself have been
updated to include that file.

The default channel configuration of the cc110x has been added
This commit is contained in:
Marian Buschsieweke 2019-08-21 14:35:31 +02:00
parent bb739907a2
commit 00965e3a40
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
12 changed files with 31 additions and 65 deletions

View File

@ -71,10 +71,4 @@ endif
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
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
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -116,10 +116,4 @@ host-tools:
$(Q)env -u CC -u CFLAGS make -C $(RIOTTOOLS)
# Set a custom channel if needed
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
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -36,10 +36,4 @@ QUIET ?= 1
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
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
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -65,10 +65,4 @@ QUIET ?= 1
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
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
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -60,6 +60,5 @@ QUIET ?= 1
include $(RIOTBASE)/Makefile.include
# Set a custom channel
DEFAULT_CHANNEL ?= 26
CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
# Set a custom channel if needed
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -49,3 +49,6 @@ DEVELHELP ?= 1
QUIET ?= 1
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -61,10 +61,4 @@ QUIET ?= 1
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
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
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -0,0 +1,13 @@
# 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

View File

@ -42,8 +42,7 @@ USEMODULE += gnrc_gomach
# reduce the size of the packet buffer a bit
CFLAGS += -DGNRC_PKTBUF_SIZE=1024
# Set a custom channel if needed
DEFAULT_CHANNEL ?= 26
CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -34,8 +34,7 @@ USEMODULE += gnrc_lwmac
# reduce the size of the packet buffer a bit
CFLAGS += -DGNRC_PKTBUF_SIZE=512
# Set a custom channel if needed
DEFAULT_CHANNEL ?= 26
CFLAGS += -DIEEE802154_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -31,10 +31,4 @@ USEMODULE += netstats_ipv6
include $(RIOTBASE)/Makefile.include
# Set a custom channel if needed
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
include $(RIOTMAKE)/default-channel.inc.mk

View File

@ -65,15 +65,4 @@ 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
include $(RIOTMAKE)/default-channel.inc.mk