From 22c6d0242acbe7fb2519974a528259d3f6a037bd Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Thu, 24 Nov 2022 17:22:13 +0100 Subject: [PATCH] drivers/at86rf2xx: add HAVE_ED_REGISTER macro --- drivers/at86rf2xx/at86rf2xx_netdev.c | 2 +- drivers/include/at86rf2xx.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/at86rf2xx/at86rf2xx_netdev.c b/drivers/at86rf2xx/at86rf2xx_netdev.c index 35023ff4c5..5fd33293af 100644 --- a/drivers/at86rf2xx/at86rf2xx_netdev.c +++ b/drivers/at86rf2xx/at86rf2xx_netdev.c @@ -223,7 +223,7 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info) netdev_ieee802154_rx_info_t *radio_info = info; at86rf2xx_fb_read(dev, &(radio_info->lqi), 1); -#if defined(MODULE_AT86RF231) || IS_ACTIVE(AT86RF2XX_PERIPH) +#if AT86RF2XX_HAVE_ED_REGISTER /* AT86RF231 does not provide ED at the end of the frame buffer, read * from separate register instead */ at86rf2xx_fb_stop(dev); diff --git a/drivers/include/at86rf2xx.h b/drivers/include/at86rf2xx.h index 4717acdd76..94664dcab8 100644 --- a/drivers/include/at86rf2xx.h +++ b/drivers/include/at86rf2xx.h @@ -116,6 +116,15 @@ extern "C" { #define AT86RF2XX_IS_PERIPH (0) #endif +/** + * @brief ED Register + */ +#if defined(MODULE_AT86RF231) || IS_ACTIVE(AT86RF2XX_PERIPH) +#define AT86RF2XX_HAVE_ED_REGISTER (1) +#else +#define AT86RF2XX_HAVE_ED_REGISTER (0) +#endif + /** * @brief Support for SubGHz bands */