Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/semtech-loramac: model in Kconfig #18005

Closed
4 changes: 3 additions & 1 deletion boards/xg23-pk6068a/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ ifneq (,$(filter saul_default,$(USEMODULE)))
endif

ifneq (,$(filter ztimer_msec ztimer_sec,$(USEMODULE)))
USEMODULE += ztimer_periph_lptimer
ifeq (,$(filter ztimer_periph_timer,$(USEMODULE)))
USEMODULE += ztimer_periph_lptimer
endif
endif
8 changes: 8 additions & 0 deletions examples/lorawan/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config APPLICATION
bool
default y
imply MODULE_PERIPH_RTC if TEST_KCONFIG

choice ZTIMER_MSEC_BACKEND
default ZTIMER_MSEC_BACKEND_TIMER
endchoice
7 changes: 7 additions & 0 deletions examples/lorawan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ USEMODULE += auto_init_loramac
USEMODULE += $(DRIVER)
USEMODULE += fmt
FEATURES_OPTIONAL += periph_rtc
# Needed to fix the backend o ztimer so the RTC is free
USEMODULE += ztimer_msec
USEMODULE += ztimer_periph_timer

# Uncomment the following line to enable Loramac stack state persistence on EEPROM.
# Make sure the EEPROM is erased before enabling this and when flashing a board
Expand Down Expand Up @@ -80,6 +83,10 @@ ifneq (,$(filter test,$(MAKECMDGOALS)))
DEFAULT_MODULE += test_utils_interactive_sync
endif

# This application provides a 'Kconfig' file and we want to explicitly disable
# Kconfig by default by setting this variable to empty
SHOULD_RUN_KCONFIG ?=

include $(RIOTBASE)/Makefile.include

ifndef CONFIG_KCONFIG_USEMODULE_LORAWAN
Expand Down
10 changes: 10 additions & 0 deletions examples/lorawan/app.config.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CONFIG_PACKAGE_SEMTECH-LORAMAC=y
CONFIG_MODULE_SX1276=y
CONFIG_MODULE_SX127X=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_MODULE_AUTO_INIT_LORAMAC=y
CONFIG_MODULE_FMT=y

CONFIG_MODULE_ZTIMER_MSEC=y
CONFIG_MODULE_ZTIMER_PERIPH_TIMER=y
CONFIG_MODULE_ZTIMER=y
38 changes: 36 additions & 2 deletions pkg/semtech-loramac/Kconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
# Copyright (c) 2020 Freie Universitaet Berlin
# 2022 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
config USEPKG_SEMTECH_LORAMAC
config PACKAGE_SEMTECH-LORAMAC
bool "Semtech Loramac-node package"
depends on TEST_KCONFIG
depends on !HAS_ARCH_MSP430

select MODULE_RANDOM
select MODULE_HASHES
select MODULE_CRYPTO_AES_128
select MODULE_ZTIMER_MSEC

select MODULE_SEMTECH_LORAMAC_CONTRIB
select MODULE_SEMTECH_LORAMAC_MAC
select MODULE_SEMTECH_LORAMAC_MAC_REGION
select MODULE_SEMTECH_LORAMAC_CRYPTO
select MODULE_SEMTECH_LORAMAC_ARCH

config MODULE_SEMTECH_LORAMAC_CONTRIB
bool

config MODULE_SEMTECH_LORAMAC_RX
bool

config MODULE_SEMTECH_LORAMAC_CONTRIB
bool

config MODULE_SEMTECH_LORAMAC_MAC
bool

config MODULE_SEMTECH_LORAMAC_MAC_REGION
bool

config MODULE_SEMTECH_LORAMAC_CRYPTO
bool

config MODULE_SEMTECH_LORAMAC_ARCH
bool
select HAVE_LORAWAN
1 change: 1 addition & 0 deletions sys/auto_init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ config AUTO_INIT_ENABLE_DEBUG
bool "Print a debug message before a module is initialized"
default n

rsource "loramac/Kconfig"
rsource "screen/Kconfig"
rsource "security/Kconfig"
rsource "multimedia/Kconfig"
Expand Down
9 changes: 9 additions & 0 deletions sys/auto_init/loramac/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2022 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#

config MODULE_AUTO_INIT_LORAMAC
bool "Loramac auto init module"
2 changes: 1 addition & 1 deletion sys/shell/cmds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ config MODULE_SHELL_CMD_SEMTECH-LORAMAC
bool "Command to control the Semtech LoRaMAC stack"
default y if MODULE_SHELL_CMDS_DEFAULT
depends on MODULE_SHELL_CMDS
depends on MODULE_SEMTECH-LORAMAC
depends on PACKAGE_SEMTECH-LORAMAC

config MODULE_SHELL_CMD_SHA1SUM
bool "Command to compute the SHA1 sum of a file"
Expand Down
6 changes: 6 additions & 0 deletions sys/ztimer/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ config ZTIMER_USEC
select MODULE_ZTIMER_USEC
select MODULE_ZTIMER_PERIPH_TIMER
select MODULE_ZTIMER
select PREFER_ZTIMER_PERIPH_TIMER

config PREFER_ZTIMER_PERIPH_TIMER
bool

config MODULE_ZTIMER_USEC
bool
Expand All @@ -71,6 +75,7 @@ config MODULE_ZTIMER_MSEC
choice ZTIMER_MSEC_BACKEND
bool "Backend"
depends on MODULE_ZTIMER_MSEC
default ZTIMER_MSEC_BACKEND_TIMER if PREFER_ZTIMER_PERIPH_TIMER
default ZTIMER_MSEC_BACKEND_LPTIMER if HAVE_ZTIMER_PERIPH_LPTIMER
default ZTIMER_MSEC_BACKEND_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT
default ZTIMER_MSEC_BACKEND_TIMER
Expand Down Expand Up @@ -98,6 +103,7 @@ config MODULE_ZTIMER_SEC
choice
bool "Backend"
depends on MODULE_ZTIMER_SEC
default ZTIMER_SEC_BACKEND_TIMER if PREFER_ZTIMER_PERIPH_TIMER
default ZTIMER_SEC_BACKEND_LPTIMER if HAVE_ZTIMER_PERIPH_LPTIMER
default ZTIMER_SEC_BACKEND_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT
default ZTIMER_SEC_BACKEND_TIMER
Expand Down
2 changes: 1 addition & 1 deletion sys/ztimer/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ endif

ifneq (,$(filter ztimer_msec ztimer_sec,$(USEMODULE)))
USEMODULE += ztimer
ifeq (,$(filter ztimer_no_periph_rtt,$(USEMODULE)))
ifeq (,$(filter ztimer_no_periph_rtt ztimer_periph_timer,$(USEMODULE)))
FEATURES_OPTIONAL += periph_rtt
# HACK: periph_rtt will get used only in the next iteration but an updated
# state for FEATURES_USED is needed here so include `features_check.inc.mk`
Expand Down
2 changes: 2 additions & 0 deletions tests/drivers/io1_xplained/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ include ../Makefile.drivers_common

USEMODULE += io1_xplained
USEMODULE += ztimer_msec
# Hack to prevent some boards from bring in rtt and periph_timer backend
USEMODULE += ztimer_periph_timer

include $(RIOTBASE)/Makefile.include
11 changes: 11 additions & 0 deletions tests/pkg/semtech-loramac/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
config APPLICATION
bool
default y
depends on TEST_KCONFIG
imply MODULE_SEMTECH_LORAMAC_RX if !BOARD_HAS_NOT_ENOUGH_MEMORY
select MODULE_PERIPH_EEPROM if HAS_PERIPH_EEPROM

config BOARD_HAS_NOT_ENOUGH_MEMORY
bool
default y
depends on BOARD_ARDUINO-MEGA2560 || BOARD_I-NUCLEO-LRWAN1 || BOARD_STM32F0DISCOVERY || BOARD_WASPMOTE-PRO
5 changes: 5 additions & 0 deletions tests/pkg/semtech-loramac/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ BOARD_WITHOUT_LORAMAC_RX := \
i-nucleo-lrwan1 \
stm32f0discovery \
waspmote-pro \
#

LORA_DRIVER ?= sx1276
LORA_REGION ?= EU868
Expand All @@ -33,4 +34,8 @@ ifneq (,$(filter iotlab%,$(MAKECMDGOALS)))
include $(RIOTBASE)/dist/testbed-support/Makefile.iotlab
endif

# This application provides a 'Kconfig' file and we want to explicitly disable
# Kconfig by default by setting this variable to empty
SHOULD_RUN_KCONFIG ?=

include $(RIOTBASE)/Makefile.include
8 changes: 8 additions & 0 deletions tests/pkg/semtech-loramac/app.config.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_PACKAGE_SEMTECH-LORAMAC=y
CONFIG_MODULE_SX1276=y
CONFIG_MODULE_SX127X=y
CONFIG_MODULE_PRNG_MUSL_LCG=y
CONFIG_MODULE_AUTO_INIT_LORAMAC=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_SHELL_CMDS_DEFAULT=y
CONFIG_MODULE_FMT=y
2 changes: 2 additions & 0 deletions tests/sys/fido2_ctap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ include ../Makefile.sys_common

USEMODULE += fido2_ctap_transport_hid
USEMODULE += usbus
# Hack to make the ztimer backend selection more deterministic
USEMODULE += ztimer_periph_timer
USEPKG += fido2_tests

USB_VID ?= $(USB_VID_TESTING)
Expand Down