drivers/at86rf2xx: remove redundant radio wakeup

This commit is contained in:
Hyungsin 2017-06-29 12:30:21 -07:00 committed by Alexandre Abadie
parent afbb00cca7
commit 112a446b9d

View File

@ -359,8 +359,11 @@ static int _set(netdev_t *netdev, netopt_t opt, void *val, size_t len)
return -ENODEV; return -ENODEV;
} }
/* temporarily wake up if sleeping */ /* temporarily wake up if sleeping and opt != NETOPT_STATE.
if (old_state == AT86RF2XX_STATE_SLEEP) { * opt != NETOPT_STATE check prevents redundant wake-up.
* when opt == NETOPT_STATE, at86rf2xx_set_state() will wake up the
* radio if needed. */
if ((old_state == AT86RF2XX_STATE_SLEEP) && (opt != NETOPT_STATE)) {
at86rf2xx_assert_awake(dev); at86rf2xx_assert_awake(dev);
} }