From 63554b1a0c03c85dc3ec64fa430598b6317099a9 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 4 Sep 2020 15:25:36 +0200 Subject: [PATCH] cpu/cc2538/radio: only build required files --- cpu/cc2538/radio/Makefile | 12 ++++++++++++ cpu/cc2538/radio/cc2538_rf_netdev.c | 5 ----- cpu/cc2538/radio/cc2538_rf_radio_ops.c | 4 ---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cpu/cc2538/radio/Makefile b/cpu/cc2538/radio/Makefile index 88ccc6c52d..cafd539d34 100644 --- a/cpu/cc2538/radio/Makefile +++ b/cpu/cc2538/radio/Makefile @@ -1,3 +1,15 @@ MODULE = cc2538_rf +SRC = \ + cc2538_rf.c \ + cc2538_rf_getset.c \ + cc2538_rf_internal.c \ + # + +ifneq (,$(filter ieee802154_radio_hal,$(USEMODULE))) + SRC += cc2538_rf_radio_ops.c +else + SRC += cc2538_rf_netdev.c +endif + include $(RIOTBASE)/Makefile.base diff --git a/cpu/cc2538/radio/cc2538_rf_netdev.c b/cpu/cc2538/radio/cc2538_rf_netdev.c index 5762685c6f..ed5827e614 100644 --- a/cpu/cc2538/radio/cc2538_rf_netdev.c +++ b/cpu/cc2538/radio/cc2538_rf_netdev.c @@ -31,8 +31,6 @@ #define ENABLE_DEBUG (0) #include "debug.h" -#if !IS_USED(MODULE_IEEE802154_RADIO_HAL) - /* Reference pointer for the IRQ handler */ static netdev_t *_dev; @@ -422,6 +420,3 @@ const netdev_driver_t cc2538_rf_driver = { .isr = _isr, .init = _init, }; -#else -int dont_be_pedantic; -#endif /* MODULE_IEEE802154_RADIO_HAL */ diff --git a/cpu/cc2538/radio/cc2538_rf_radio_ops.c b/cpu/cc2538/radio/cc2538_rf_radio_ops.c index 688daecc10..1ed5f1d678 100644 --- a/cpu/cc2538/radio/cc2538_rf_radio_ops.c +++ b/cpu/cc2538/radio/cc2538_rf_radio_ops.c @@ -8,7 +8,6 @@ #include "net/ieee802154/radio.h" -#if IS_USED(MODULE_IEEE802154_RADIO_HAL) static const ieee802154_radio_ops_t cc2538_rf_ops; ieee802154_dev_t cc2538_rf_dev = { @@ -487,6 +486,3 @@ static const ieee802154_radio_ops_t cc2538_rf_ops = { .set_csma_params = _set_csma_params, .set_rx_mode = _set_rx_mode, }; -#else -int dont_be_pedantic; -#endif