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

makefiles: clean up default-channel.inc.mk

Clean up `default-channel.inc.mk` to only set the custom CFLAGS
if they are really needed.
This should help avoid cluttering `riotbuild.h`.

The default PAN ID configuration should be just as easy to set
as the default channel, so also add an option for that while we
are at it.
This commit is contained in:
Benjamin Valentin 2019-10-21 19:27:34 +02:00 committed by Benjamin Valentin
parent c1ea3c2eb6
commit 7f1393496b

View File

@ -1,13 +1,17 @@
# 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 (,$(DEFAULT_CHANNEL))
ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz
CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
endif
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
# Set a custom PAN ID if needed
ifneq (,$(DEFAULT_PAN_ID))
CFLAGS += -DIEEE802154_DEFAULT_PANID=$(DEFAULT_PAN_ID)
endif