1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/atwinc15x0: make use of wake pin

This commit is contained in:
Benjamin Valentin 2022-03-31 16:52:40 +02:00
parent 14121a5298
commit 37159fe4d9

View File

@ -443,8 +443,14 @@ static int _set_state(atwinc15x0_t *dev, netopt_state_t state)
m2m_wifi_disconnect();
m2m_wifi_set_sleep_mode(M2M_PS_MANUAL, CONFIG_ATWINC15X0_RECV_BCAST);
m2m_wifi_request_sleep(UINT32_MAX);
if (gpio_is_valid(atwinc15x0->params.wake_pin)) {
gpio_clear(atwinc15x0->params.wake_pin);
}
return sizeof(netopt_state_t);
case NETOPT_STATE_IDLE:
if (gpio_is_valid(atwinc15x0->params.wake_pin)) {
gpio_set(atwinc15x0->params.wake_pin);
}
m2m_wifi_set_sleep_mode(M2M_PS_DEEP_AUTOMATIC, CONFIG_ATWINC15X0_RECV_BCAST);
dev->state = state;
_atwinc15x0_connect();