From 246391a9fab308746d88c3a825efe4189d302ab1 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 2 Feb 2021 10:56:01 +0100 Subject: [PATCH] cpu/nrf52/nrf802154: use driver specific legacy pseudomodule This introduces the nrf802154_netdev_legacy pseudomodule that switches to the netdev-based implementation of the nrf802154 radio driver. --- cpu/nrf52/Makefile.dep | 5 +++-- cpu/nrf52/include/nrf802154.h | 4 ++-- cpu/nrf52/radio/nrf802154/Makefile | 7 ++++--- makefiles/pseudomodules.inc.mk | 1 + 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cpu/nrf52/Makefile.dep b/cpu/nrf52/Makefile.dep index 9dc5836063..b42cbfc6bc 100644 --- a/cpu/nrf52/Makefile.dep +++ b/cpu/nrf52/Makefile.dep @@ -4,8 +4,9 @@ ifneq (,$(filter nrf802154,$(USEMODULE))) FEATURES_REQUIRED += periph_timer FEATURES_REQUIRED += radio_nrf802154 USEMODULE += luid - USEMODULE += netdev_ieee802154 - ifeq (,$(filter netdev_ieee802154_legacy,$(USEMODULE))) + ifneq (,$(filter nrf802154_netdev_legacy,$(USEMODULE))) + USEMODULE += netdev_ieee802154 + else ifneq (,$(filter netdev,$(USEMODULE))) USEMODULE += netdev_ieee802154_submac endif endif diff --git a/cpu/nrf52/include/nrf802154.h b/cpu/nrf52/include/nrf802154.h index 33a9428bfb..aab8fab59e 100644 --- a/cpu/nrf52/include/nrf802154.h +++ b/cpu/nrf52/include/nrf802154.h @@ -36,7 +36,7 @@ #ifndef NRF802154_H #define NRF802154_H -#if IS_USED(MODULE_IEEE802154_RADIO_HAL) +#if !IS_USED(MODULE_NRF802154_NETDEV_LEGACY) #include "net/ieee802154/radio.h" #if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC) #include "net/netdev/ieee802154_submac.h" @@ -58,7 +58,7 @@ extern "C" { typedef struct { #if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC) netdev_ieee802154_submac_t netdev; /**< netdev SubMAC descriptor */ -#elif !IS_USED(MODULE_IEEE802154_RADIO_HAL) +#elif IS_USED(MODULE_NRF802154_NETDEV_LEGACY) netdev_ieee802154_t netdev; /**< ieee802154 device descriptor */ #endif } nrf802154_t; diff --git a/cpu/nrf52/radio/nrf802154/Makefile b/cpu/nrf52/radio/nrf802154/Makefile index b83537831a..5e95315e64 100644 --- a/cpu/nrf52/radio/nrf802154/Makefile +++ b/cpu/nrf52/radio/nrf802154/Makefile @@ -1,9 +1,10 @@ MODULE = nrf802154 -ifneq (,$(filter ieee802154_radio_hal,$(USEMODULE))) - SRC += nrf802154_radio.c -else +# use netdev implementation when legacy is explicitly enabled +ifneq (,$(filter nrf802154_netdev_legacy,$(USEMODULE))) SRC += nrf802154.c +else + SRC += nrf802154_radio.c endif include $(RIOTBASE)/Makefile.base diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 231445c2e3..7359f60862 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -105,6 +105,7 @@ PSEUDOMODULES += newlib PSEUDOMODULES += newlib_gnu_source PSEUDOMODULES += newlib_nano PSEUDOMODULES += nrf24l01p_ng_diagnostics +PSEUDOMODULES += nrf802154_netdev_legacy PSEUDOMODULES += openthread PSEUDOMODULES += picolibc PSEUDOMODULES += picolibc_stdout_buffered