diff options
author | Christoffer Holmstedt <christoffer.holmstedt@gmail.com> | 2015-04-30 11:44:56 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-04-30 12:48:09 -0400 |
commit | 4748e86ecf262ae9d94b7e4073653554951ceb7a (patch) | |
tree | ff95034912e8d713cf91085595d26f5bdc9870fb /drivers/net/ieee802154 | |
parent | 1cc800e7aabb40e2d8ffc3d259e6a153007fa9eb (diff) |
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: Christoffer Holmstedt <christoffer.holmstedt@gmail.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net/ieee802154')
-rw-r--r-- | drivers/net/ieee802154/at86rf230.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 38026650c038..684488acc65d 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c | |||
@@ -292,6 +292,8 @@ struct at86rf230_local { | |||
292 | #define STATE_BUSY_RX_AACK_NOCLK 0x1E | 292 | #define STATE_BUSY_RX_AACK_NOCLK 0x1E |
293 | #define STATE_TRANSITION_IN_PROGRESS 0x1F | 293 | #define STATE_TRANSITION_IN_PROGRESS 0x1F |
294 | 294 | ||
295 | #define TRX_STATE_MASK (0x1F) | ||
296 | |||
295 | #define AT86RF2XX_NUMREGS 0x3F | 297 | #define AT86RF2XX_NUMREGS 0x3F |
296 | 298 | ||
297 | static void | 299 | static void |
@@ -509,7 +511,7 @@ at86rf230_async_state_assert(void *context) | |||
509 | struct at86rf230_state_change *ctx = context; | 511 | struct at86rf230_state_change *ctx = context; |
510 | struct at86rf230_local *lp = ctx->lp; | 512 | struct at86rf230_local *lp = ctx->lp; |
511 | const u8 *buf = ctx->buf; | 513 | const u8 *buf = ctx->buf; |
512 | const u8 trx_state = buf[1] & 0x1f; | 514 | const u8 trx_state = buf[1] & TRX_STATE_MASK; |
513 | 515 | ||
514 | /* Assert state change */ | 516 | /* Assert state change */ |
515 | if (trx_state != ctx->to_state) { | 517 | if (trx_state != ctx->to_state) { |
@@ -667,7 +669,7 @@ at86rf230_async_state_change_start(void *context) | |||
667 | struct at86rf230_state_change *ctx = context; | 669 | struct at86rf230_state_change *ctx = context; |
668 | struct at86rf230_local *lp = ctx->lp; | 670 | struct at86rf230_local *lp = ctx->lp; |
669 | u8 *buf = ctx->buf; | 671 | u8 *buf = ctx->buf; |
670 | const u8 trx_state = buf[1] & 0x1f; | 672 | const u8 trx_state = buf[1] & TRX_STATE_MASK; |
671 | int rc; | 673 | int rc; |
672 | 674 | ||
673 | /* Check for "possible" STATE_TRANSITION_IN_PROGRESS */ | 675 | /* Check for "possible" STATE_TRANSITION_IN_PROGRESS */ |