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:
parent
bb739907a2
commit
00965e3a40
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -49,3 +49,6 @@ DEVELHELP ?= 1
|
||||
QUIET ?= 1
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
# Set a custom channel if needed
|
||||
include $(RIOTMAKE)/default-channel.inc.mk
|
||||
|
@ -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
|
||||
|
13
makefiles/default-channel.inc.mk
Normal file
13
makefiles/default-channel.inc.mk
Normal 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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user