Commit 4748e86e authored by Christoffer Holmstedt's avatar Christoffer Holmstedt Committed by Marcel Holtmann

at86rf230: Add macro for TRX STATE MASK

Instead of using the 'magic' number of 0x1f the TRX_STATE_MASK macro is
introduced.
Signed-off-by: default avatarChristoffer Holmstedt <christoffer.holmstedt@gmail.com>
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 1cc800e7
...@@ -292,6 +292,8 @@ struct at86rf230_local { ...@@ -292,6 +292,8 @@ struct at86rf230_local {
#define STATE_BUSY_RX_AACK_NOCLK 0x1E #define STATE_BUSY_RX_AACK_NOCLK 0x1E
#define STATE_TRANSITION_IN_PROGRESS 0x1F #define STATE_TRANSITION_IN_PROGRESS 0x1F
#define TRX_STATE_MASK (0x1F)
#define AT86RF2XX_NUMREGS 0x3F #define AT86RF2XX_NUMREGS 0x3F
static void static void
...@@ -509,7 +511,7 @@ at86rf230_async_state_assert(void *context) ...@@ -509,7 +511,7 @@ at86rf230_async_state_assert(void *context)
struct at86rf230_state_change *ctx = context; struct at86rf230_state_change *ctx = context;
struct at86rf230_local *lp = ctx->lp; struct at86rf230_local *lp = ctx->lp;
const u8 *buf = ctx->buf; const u8 *buf = ctx->buf;
const u8 trx_state = buf[1] & 0x1f; const u8 trx_state = buf[1] & TRX_STATE_MASK;
/* Assert state change */ /* Assert state change */
if (trx_state != ctx->to_state) { if (trx_state != ctx->to_state) {
...@@ -667,7 +669,7 @@ at86rf230_async_state_change_start(void *context) ...@@ -667,7 +669,7 @@ at86rf230_async_state_change_start(void *context)
struct at86rf230_state_change *ctx = context; struct at86rf230_state_change *ctx = context;
struct at86rf230_local *lp = ctx->lp; struct at86rf230_local *lp = ctx->lp;
u8 *buf = ctx->buf; u8 *buf = ctx->buf;
const u8 trx_state = buf[1] & 0x1f; const u8 trx_state = buf[1] & TRX_STATE_MASK;
int rc; int rc;
/* Check for "possible" STATE_TRANSITION_IN_PROGRESS */ /* Check for "possible" STATE_TRANSITION_IN_PROGRESS */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment