drivers: ieee802154_rf2xx: Remove magic number

Define and use RF2XX_TRAC_STATUS instead of magic number.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2023-01-31 15:49:56 +02:00 committed by Carles Cufí
parent 72c5bc3ae2
commit 9c1076e7f7
2 changed files with 3 additions and 2 deletions

View file

@ -267,7 +267,7 @@ static void rf2xx_process_tx_frame(const struct device *dev)
struct rf2xx_context *ctx = dev->data;
ctx->trx_trac = (rf2xx_iface_reg_read(dev, RF2XX_TRX_STATE_REG) >>
RF2XX_TRAC_STATUS) & 7;
RF2XX_TRAC_STATUS) & RF2XX_TRAC_BIT_MASK;
k_sem_give(&ctx->trx_tx_sync);
rf2xx_trx_set_rx_state(dev);
}

View file

@ -100,6 +100,7 @@
/* TRX_STATE */
#define RF2XX_TRAC_STATUS 5
#define RF2XX_TRX_CMD 0
#define RF2XX_TRAC_BIT_MASK 7
/* TRX_CTRL_0 */
#define RF2XX_TOM_EN 7
@ -295,6 +296,6 @@
/* RX_STATUS */
#define RF2XX_RX_TRAC_STATUS 4
#define RF2XX_RX_TRAC_BIT_MASK 0x07
#define RF2XX_RX_TRAC_BIT_MASK RF2XX_TRAC_BIT_MASK
#endif /* ZEPHYR_DRIVERS_IEEE802154_IEEE802154_RF2XX_REGS_H_ */