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:
parent
72c5bc3ae2
commit
9c1076e7f7
|
@ -267,7 +267,7 @@ static void rf2xx_process_tx_frame(const struct device *dev)
|
||||||
struct rf2xx_context *ctx = dev->data;
|
struct rf2xx_context *ctx = dev->data;
|
||||||
|
|
||||||
ctx->trx_trac = (rf2xx_iface_reg_read(dev, RF2XX_TRX_STATE_REG) >>
|
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);
|
k_sem_give(&ctx->trx_tx_sync);
|
||||||
rf2xx_trx_set_rx_state(dev);
|
rf2xx_trx_set_rx_state(dev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,6 +100,7 @@
|
||||||
/* TRX_STATE */
|
/* TRX_STATE */
|
||||||
#define RF2XX_TRAC_STATUS 5
|
#define RF2XX_TRAC_STATUS 5
|
||||||
#define RF2XX_TRX_CMD 0
|
#define RF2XX_TRX_CMD 0
|
||||||
|
#define RF2XX_TRAC_BIT_MASK 7
|
||||||
|
|
||||||
/* TRX_CTRL_0 */
|
/* TRX_CTRL_0 */
|
||||||
#define RF2XX_TOM_EN 7
|
#define RF2XX_TOM_EN 7
|
||||||
|
@ -295,6 +296,6 @@
|
||||||
|
|
||||||
/* RX_STATUS */
|
/* RX_STATUS */
|
||||||
#define RF2XX_RX_TRAC_STATUS 4
|
#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_ */
|
#endif /* ZEPHYR_DRIVERS_IEEE802154_IEEE802154_RF2XX_REGS_H_ */
|
||||||
|
|
Loading…
Reference in a new issue