Commit ed4a26b0 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

at86rf230: interrupt tx with force trx_off

To abort a TX_ARET_BUSY state it's recommended to switch into TRX_OFF
state by doing STATE_TRX_FORCE_OFF. This patch will do always a TRX_OFF
state change when the transceiver stucks in any state. From TRX_OFF we
can switch to the states which are also possible by TX_ON state.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Reviewed-by: default avatarStefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 346ce4bb
...@@ -377,14 +377,6 @@ at86rf230_async_read_reg(struct at86rf230_local *lp, const u8 reg, ...@@ -377,14 +377,6 @@ at86rf230_async_read_reg(struct at86rf230_local *lp, const u8 reg,
} }
} }
static inline u8 at86rf230_state_to_force(u8 state)
{
if (state == STATE_TX_ON)
return STATE_FORCE_TX_ON;
else
return STATE_FORCE_TRX_OFF;
}
static void static void
at86rf230_async_state_assert(void *context) at86rf230_async_state_assert(void *context)
{ {
...@@ -426,7 +418,7 @@ at86rf230_async_state_assert(void *context) ...@@ -426,7 +418,7 @@ at86rf230_async_state_assert(void *context)
u8 state = ctx->to_state; u8 state = ctx->to_state;
if (lp->tx_retry >= AT86RF2XX_MAX_TX_RETRIES) if (lp->tx_retry >= AT86RF2XX_MAX_TX_RETRIES)
state = at86rf230_state_to_force(state); state = STATE_FORCE_TRX_OFF;
lp->tx_retry++; lp->tx_retry++;
at86rf230_async_state_change(lp, ctx, state, at86rf230_async_state_change(lp, ctx, state,
......
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