mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 22:13:52 +01:00
Merge pull request #11583 from aabadie/pr/pkg/semtech-loramac-cflags
pkg/semtech-loramac: move region CFLAGS definitions from applications to pkg
This commit is contained in:
commit
b8d602abdc
@ -17,7 +17,7 @@ APPKEY ?= 00000000000000000000000000000000
|
||||
DRIVER ?= sx1276
|
||||
|
||||
# Default region is Europe and default band is 868MHz
|
||||
REGION ?= EU868
|
||||
LORA_REGION ?= EU868
|
||||
|
||||
# Include the Semtech-loramac package
|
||||
USEPKG += semtech-loramac
|
||||
@ -26,9 +26,7 @@ USEMODULE += $(DRIVER)
|
||||
USEMODULE += fmt
|
||||
FEATURES_REQUIRED += periph_rtc
|
||||
|
||||
CFLAGS += -DREGION_$(REGION)
|
||||
CFLAGS += -DDEVEUI=\"$(DEVEUI)\" -DAPPEUI=\"$(APPEUI)\" -DAPPKEY=\"$(APPKEY)\"
|
||||
CFLAGS += -DLORAMAC_ACTIVE_REGION=LORAMAC_REGION_$(REGION)
|
||||
|
||||
# Comment this out to disable code in RIOT that does safety checking
|
||||
# which is not needed in a production environment but helps in the
|
||||
|
||||
@ -18,12 +18,12 @@ Simply build and flash the application for a ST B-L072Z-LRWAN1 board:
|
||||
|
||||
make flash term
|
||||
|
||||
Use the `BOARD`, `DRIVER` and `REGION` make variables to adapt the application
|
||||
Use the `BOARD`, `DRIVER` and `LORA_REGION` make variables to adapt the application
|
||||
to your hardware setup and region of use:
|
||||
|
||||
- `BOARD` can be one of the nucleo-64 boards
|
||||
- `DRIVER` can be either `sx1276` or `sx1272`
|
||||
- `REGION` can be `EU868`, `US915`, etc (see LoRaWAN regional parameters for
|
||||
- `LORA_REGION` can be `EU868`, `US915`, etc (see LoRaWAN regional parameters for
|
||||
details).
|
||||
|
||||
ST Nucleo-64 can be used with mbed LoRa shields: there's one based on
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
INCLUDES += -I$(RIOTBASE)/pkg/semtech-loramac/include
|
||||
|
||||
DIRS += $(RIOTBASE)/pkg/semtech-loramac/contrib
|
||||
|
||||
# Use EU868 as default region
|
||||
LORA_REGION ?= EU868
|
||||
|
||||
CFLAGS += -DREGION_$(LORA_REGION)
|
||||
CFLAGS += -DLORAMAC_ACTIVE_REGION=LORAMAC_REGION_$(LORA_REGION)
|
||||
|
||||
@ -31,8 +31,7 @@
|
||||
* to the physical support, the region where the device is used needs to be
|
||||
* set at compile time. Example for EU868:
|
||||
* ```
|
||||
* CFLAGS += -DREGION_EU868
|
||||
* CFLAGS += -DLORAMAC_ACTIVE_REGION=LORAMAC_REGION_EU868
|
||||
* LORA_REGION = EU868
|
||||
* ```
|
||||
*
|
||||
* # Using the package API
|
||||
|
||||
@ -21,7 +21,4 @@ USEMODULE += fmt
|
||||
|
||||
FEATURES_OPTIONAL += periph_eeprom
|
||||
|
||||
CFLAGS += -DREGION_$(LORA_REGION)
|
||||
CFLAGS += -DLORAMAC_ACTIVE_REGION=LORAMAC_REGION_$(LORA_REGION)
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user