Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions drivers/at86rf2xx/at86rf2xx_getset.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,6 @@ void at86rf2xx_set_state(at86rf2xx_t *dev, uint8_t state)
return;
}

if (state == AT86RF2XX_STATE_FORCE_TRX_OFF) {
_set_state(dev, AT86RF2XX_STATE_TRX_OFF, state);
return;
}

/* make sure there is no ongoing transmission, or state transition already
* in progress */
Expand All @@ -465,6 +461,11 @@ void at86rf2xx_set_state(at86rf2xx_t *dev, uint8_t state)
old_state = at86rf2xx_get_status(dev);
}

if (state == AT86RF2XX_STATE_FORCE_TRX_OFF) {
_set_state(dev, AT86RF2XX_STATE_TRX_OFF, state);
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see how moving this block helps. at86rf2xx_configure_phy uses AT86RF2XX_STATE_TRX_OFF not AT86RF2XX_STATE_FORCE_TRX_OFF thus it shouldn't have an effect.

if (state == old_state) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/at86rf2xx/at86rf2xx_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void at86rf2xx_hardware_reset(at86rf2xx_t *dev)

void at86rf2xx_configure_phy(at86rf2xx_t *dev)
{
while (AT86RF2XX_STATE_IN_PROGRESS == at86rf2xx_get_status(dev)) {}
uint8_t state = at86rf2xx_get_status(dev);

/* we must be in TRX_OFF before changing the PHY configuration */
Expand Down