drivers: ieee802154: nrf5: sleep if idle when RxOnWhenIdle=0
When RxOnWhenIdle is set to False, turn the radio off if no operation is ongoing in order to save power. Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
This commit is contained in:
parent
4586388b3b
commit
01b0d8736e
1 changed files with 4 additions and 0 deletions
|
@ -1005,6 +1005,10 @@ static int nrf5_configure(const struct device *dev,
|
||||||
case IEEE802154_CONFIG_RX_ON_WHEN_IDLE:
|
case IEEE802154_CONFIG_RX_ON_WHEN_IDLE:
|
||||||
nrf_802154_rx_on_when_idle_set(config->rx_on_when_idle);
|
nrf_802154_rx_on_when_idle_set(config->rx_on_when_idle);
|
||||||
nrf5_data.rx_on_when_idle = config->rx_on_when_idle;
|
nrf5_data.rx_on_when_idle = config->rx_on_when_idle;
|
||||||
|
|
||||||
|
if (config->rx_on_when_idle == false) {
|
||||||
|
(void)nrf_802154_sleep_if_idle();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue