cpu/cc2538/radio: use driver specific legacy pseudomodule
This introduces the cc2538_rf_netdev_legacy pseudomodule that switches to the netdev-based implementation of the cc2538 radio driver.
This commit is contained in:
parent
fe5c982fa6
commit
f0e7dfdf76
@ -1,6 +1,7 @@
|
|||||||
ifneq (,$(filter cc2538_rf,$(USEMODULE)))
|
ifneq (,$(filter cc2538_rf,$(USEMODULE)))
|
||||||
USEMODULE += netdev_ieee802154
|
ifneq (,$(filter cc2538_rf_netdev_legacy,$(USEMODULE)))
|
||||||
ifeq (,$(filter netdev_ieee802154_legacy,$(USEMODULE)))
|
USEMODULE += netdev_ieee802154
|
||||||
|
else ifneq (,$(filter netdev,$(USEMODULE)))
|
||||||
USEMODULE += netdev_ieee802154_submac
|
USEMODULE += netdev_ieee802154_submac
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
#include "net/ieee802154.h"
|
#include "net/ieee802154.h"
|
||||||
#include "kernel_defines.h"
|
#include "kernel_defines.h"
|
||||||
|
|
||||||
#if IS_USED(MODULE_IEEE802154_RADIO_HAL)
|
#if !IS_USED(MODULE_CC2538_RF_NETDEV_LEGACY)
|
||||||
#include "net/ieee802154/radio.h"
|
#include "net/ieee802154/radio.h"
|
||||||
#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
|
#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
|
||||||
#include "net/netdev/ieee802154_submac.h"
|
#include "net/netdev/ieee802154_submac.h"
|
||||||
@ -292,7 +292,7 @@ enum {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
|
#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
|
||||||
netdev_ieee802154_submac_t netdev; /**< netdev parent struct */
|
netdev_ieee802154_submac_t netdev; /**< netdev parent struct */
|
||||||
#elif !IS_USED(MODULE_IEEE802154_RADIO_HAL)
|
#elif IS_USED(MODULE_CC2538_RF_NETDEV_LEGACY)
|
||||||
netdev_ieee802154_t netdev; /**< netdev parent struct */
|
netdev_ieee802154_t netdev; /**< netdev parent struct */
|
||||||
#endif
|
#endif
|
||||||
uint8_t state; /**< current state of the radio */
|
uint8_t state; /**< current state of the radio */
|
||||||
|
|||||||
@ -6,10 +6,11 @@ SRC = \
|
|||||||
cc2538_rf_internal.c \
|
cc2538_rf_internal.c \
|
||||||
#
|
#
|
||||||
|
|
||||||
ifneq (,$(filter ieee802154_radio_hal,$(USEMODULE)))
|
# use netdev implementation when legacy is explicitly enabled
|
||||||
SRC += cc2538_rf_radio_ops.c
|
ifneq (,$(filter cc2538_rf_netdev_legacy,$(USEMODULE)))
|
||||||
else
|
|
||||||
SRC += cc2538_rf_netdev.c
|
SRC += cc2538_rf_netdev.c
|
||||||
|
else
|
||||||
|
SRC += cc2538_rf_radio_ops.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.base
|
include $(RIOTBASE)/Makefile.base
|
||||||
|
|||||||
@ -136,7 +136,7 @@ void cc2538_init(void)
|
|||||||
RFCORE_XREG_FIFOPCTRL = CC2538_RF_MAX_DATA_LEN;
|
RFCORE_XREG_FIFOPCTRL = CC2538_RF_MAX_DATA_LEN;
|
||||||
|
|
||||||
/* Set default IRQ */
|
/* Set default IRQ */
|
||||||
if (IS_USED(MODULE_IEEE802154_RADIO_HAL)) {
|
if (!IS_USED(MODULE_CC2538_RF_NETDEV_LEGACY)) {
|
||||||
RFCORE_XREG_RFIRQM1 = TXDONE | CSP_STOP | TXACKDONE;
|
RFCORE_XREG_RFIRQM1 = TXDONE | CSP_STOP | TXACKDONE;
|
||||||
RFCORE_XREG_RFIRQM0 = RXPKTDONE | FIFOP | SFD;
|
RFCORE_XREG_RFIRQM0 = RXPKTDONE | FIFOP | SFD;
|
||||||
} else {
|
} else {
|
||||||
@ -212,7 +212,7 @@ bool cc2538_on(void)
|
|||||||
|
|
||||||
void cc2538_setup(cc2538_rf_t *dev)
|
void cc2538_setup(cc2538_rf_t *dev)
|
||||||
{
|
{
|
||||||
#if IS_USED(MODULE_IEEE802154_RADIO_HAL)
|
#if !IS_USED(MODULE_CC2538_RF_NETDEV_LEGACY)
|
||||||
(void) dev;
|
(void) dev;
|
||||||
#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
|
#if IS_USED(MODULE_NETDEV_IEEE802154_SUBMAC)
|
||||||
extern ieee802154_dev_t cc2538_rf_dev;
|
extern ieee802154_dev_t cc2538_rf_dev;
|
||||||
|
|||||||
@ -13,6 +13,7 @@ PSEUDOMODULES += can_pm
|
|||||||
PSEUDOMODULES += can_raw
|
PSEUDOMODULES += can_raw
|
||||||
PSEUDOMODULES += ccn-lite-utils
|
PSEUDOMODULES += ccn-lite-utils
|
||||||
PSEUDOMODULES += cc2538_rf_obs_sig
|
PSEUDOMODULES += cc2538_rf_obs_sig
|
||||||
|
PSEUDOMODULES += cc2538_rf_netdev_legacy
|
||||||
PSEUDOMODULES += conn_can_isotp_multi
|
PSEUDOMODULES += conn_can_isotp_multi
|
||||||
PSEUDOMODULES += cord_ep_standalone
|
PSEUDOMODULES += cord_ep_standalone
|
||||||
PSEUDOMODULES += core_%
|
PSEUDOMODULES += core_%
|
||||||
@ -67,7 +68,6 @@ PSEUDOMODULES += gnrc_sock_check_reuse
|
|||||||
PSEUDOMODULES += gnrc_txtsnd
|
PSEUDOMODULES += gnrc_txtsnd
|
||||||
PSEUDOMODULES += heap_cmd
|
PSEUDOMODULES += heap_cmd
|
||||||
PSEUDOMODULES += i2c_scan
|
PSEUDOMODULES += i2c_scan
|
||||||
PSEUDOMODULES += ieee802154_radio_hal
|
|
||||||
PSEUDOMODULES += ieee802154_security
|
PSEUDOMODULES += ieee802154_security
|
||||||
PSEUDOMODULES += ieee802154_submac
|
PSEUDOMODULES += ieee802154_submac
|
||||||
PSEUDOMODULES += ina3221_alerts
|
PSEUDOMODULES += ina3221_alerts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user