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

Merge pull request #16780 from fjmolinas/pr_kconfig_uwb

pkg/uwb*: add Kconfig dependency modelling
This commit is contained in:
Leandro Lanzieri 2021-11-01 09:35:29 +01:00 committed by GitHub
commit 4011bd9edf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 169 additions and 12 deletions

View File

@ -0,0 +1,12 @@
CONFIG_PACKAGE_UWB-CORE=y
CONFIG_PACKAGE_UWB-DW1000=y
CONFIG_MODULE_UWB-CORE_TWR_SS=y
CONFIG_MODULE_UWB-CORE_TWR_SS_ACK=y
CONFIG_MODULE_UWB-CORE_TWR_SS_EXT=y
CONFIG_MODULE_UWB-CORE_TWR_DS=y
CONFIG_MODULE_UWB-CORE_TWR_DS_EXT=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_PS=y
CONFIG_MODULE_SHELL_COMMANDS=y
CONFIG_MODULE_ZTIMER=y
CONFIG_MODULE_ZTIMER_USEC=y

View File

@ -29,6 +29,7 @@ rsource "micro-ecc/Kconfig"
rsource "microcoap/Kconfig"
rsource "minmea/Kconfig"
rsource "monocypher/Kconfig"
rsource "mynewt-core/Kconfig"
rsource "nanocbor/Kconfig"
rsource "nanopb/Kconfig"
rsource "qcbor/Kconfig"
@ -48,6 +49,8 @@ rsource "ubasic/Kconfig"
rsource "ucglib/Kconfig"
rsource "umorse/Kconfig"
rsource "utensor/Kconfig"
rsource "uwb-core/Kconfig"
rsource "uwb-dw1000/Kconfig"
rsource "wakaama/Kconfig"
rsource "yxml/Kconfig"

41
pkg/mynewt-core/Kconfig Normal file
View File

@ -0,0 +1,41 @@
# Copyright (c) 2021 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.
#
menuconfig PACKAGE_MYNEWT-CORE
bool "Apache MyNewt mynewt-core Package"
depends on TEST_KCONFIG
select MODULE_MYNEWT-CORE
select MODULE_SEMA
select MODULE_ZTIMER
select MODULE_ZTIMER_MSEC
select MODULE_EVENT
select MODULE_EVENT_CALLBACK
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_GPIO
depends on !HAS_ARCH_ESP
if PACKAGE_MYNEWT-CORE
config MODULE_MYNEWT-CORE
bool
config MODULE_AUTO_INIT_MYNEWT-CORE
bool "Auto-initialize the mynewt-core package"
default y
depends on MODULE_AUTO_INIT
config MODULE_MYNEWT-CORE_OS
bool "mynewt-core kernel module"
config MODULE_MYNEWT-CORE_UTIL
bool "mynewt-core utilities modules"
config MODULE_MYNEWT-CORE_NRF5X_HAL
bool "mynewt-core nrf52 and nrf51 timer hal"
endif # PACKAGE_MYNEWT-CORE

View File

@ -1,17 +1,9 @@
USEMODULE += event_callback
USEMODULE += sema
USEMODULE += ztimer
USEMODULE += ztimer_msec
USEMODULE += mynewt-core
DEFAULT_MODULE += auto_init_mynewt-core
# MyNewt `os_hw_is_in_critical` function needs to know whether ISR are masked
# of if the function is being called in ISR context. There is no such function
# in RIOT except for arm (__get_PRIMASK), therefore unless a similar function
# is provided for other arch, this port is currently only enabled for those arch.
# Note: that this should not be a hindrance since nimble only works on nordic
# and uwb-core breakouts are all arm.
FEATURES_REQUIRED += arch_arm
FEATURES_BLACKLIST += arch_arm7
# esp frequency is not pow2 so is incompatible with os_cputime
FEATURES_BLACKLIST += arch_esp

View File

@ -117,7 +117,7 @@ static inline void os_hw_exit_critical(uint32_t ctx)
*/
static inline bool os_hw_is_in_critical(void)
{
return (irq_is_in() || __get_PRIMASK());
return (irq_is_in() || !irq_is_enabled());
}
/* Mynewt components (not abstracted in NPL or DPL) */

80
pkg/uwb-core/Kconfig Normal file
View File

@ -0,0 +1,80 @@
# Copyright (c) 2021 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.
#
menuconfig PACKAGE_UWB-CORE
bool "Decawave uwb-core package"
select MODULE_UWB-CORE_DPL
select MODULE_UWB-CORE_CONTRIB
select MODULE_FMT
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_GPIO
depends on HAS_PERIPH_GPIO_IRQ
select MODULE_PERIPH_GPIO_IRQ
depends on HAS_PERIPH_SPI
select MODULE_PERIPH_SPI
depends on !HAS_ARCH_NATIVE
depends on !HAS_ARCH_AVR8
if PACKAGE_UWB-CORE
config MODULE_AUTO_INIT_UWB-CORE
bool "Auto-initialize the usb-core package"
default y
depends on MODULE_AUTO_INIT
config MODULE_UWB-CORE_CONTRIB
bool
config MODULE_UWB-CORE_DPL
bool
select PACKAGE_MYNEWT-CORE
select MODULE_MYNEWT-CORE_OS
select MODULE_MYNEWT-CORE_NRF5X_HAL if HAS_CPU_NRF52 || HAS_CPU_NRF51
config MODULE_UWB-CORE_TWR_SS
bool "uwb-core two-way-ranging single sided"
select MODULE_UWB-CORE_RNG
config MODULE_UWB-CORE_TWR_SS_ACK
bool "uwb-core two-way-ranging single sided using hardware generated ack as response"
select MODULE_UWB-CORE_RNG
config MODULE_UWB-CORE_TWR_SS_EXT
bool "uwb-core two-way-ranging single sided with extended frames"
select MODULE_UWB-CORE_RNG
config MODULE_UWB-CORE_TWR_DS
bool "uwb-core two-way-ranging double sided"
select MODULE_UWB-CORE_RNG
config MODULE_UWB-CORE_TWR_DS_EXT
bool "uwb-core two-way-ranging double sided with extended frames"
select MODULE_UWB-CORE_RNG
config MODULE_UWB-CORE_RNG
bool "uwb-core ranging module"
select MODULE_UWB-CORE_RNG_MATH
select MODULE_UWB-CORE_DSP
select MODULE_UWB-CORE_UWB_JSON
config MODULE_UWB-CORE_UWB_JSON
bool "uwb-core JSON utilities"
config MODULE_UWB-CORE_DSP
bool "uwb-core DSP module"
config MODULE_UWB-CORE_RNG_MATH
bool "uwb-core ranging math utilities"
config MODULE_UWB-CORE_UWBCFG
bool "uwb-core configuration module"
select MODULE_UWB-CORE_CONFIG
config MODULE_UWB-CORE_CONFIG
bool
endif # PACKAGE_UWB-CORE

29
pkg/uwb-dw1000/Kconfig Normal file
View File

@ -0,0 +1,29 @@
# Copyright (c) 2021 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.
#
menuconfig PACKAGE_UWB-DW1000
bool "Decawave dw1000 driver package"
select MODULE_UWB-DW1000_HAL
depends on HAS_PERIPH_GPIO
select MODULE_PERIPH_GPIO
depends on HAS_PERIPH_GPIO_IRQ
select MODULE_PERIPH_GPIO_IRQ
depends on HAS_PERIPH_SPI
select MODULE_PERIPH_SPI
depends on HAS_ARCH_32BIT
if PACKAGE_UWB-DW1000
config MODULE_AUTO_INIT_UWB-DW1000
bool "Auto-initialize the uwb-dw1000 package"
default y
depends on MODULE_AUTO_INIT
config MODULE_UWB-DW1000_HAL
bool
endif # PACKAGE_UWB-DW1000

View File

@ -8,4 +8,4 @@
config MODULE_SEMA
bool "Semaphore"
depends on TEST_KCONFIG
select MODULE_XTIMER
depends on MODULE_XTIMER || MODULE_ZTIMER