From 566935af44ee581a020c0a35dc76b0d85353bf26 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 23 Aug 2022 18:23:05 +0200 Subject: [PATCH] drivers/atwinc15x0: add RESET state --- drivers/atwinc15x0/atwinc15x0_netdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/atwinc15x0/atwinc15x0_netdev.c b/drivers/atwinc15x0/atwinc15x0_netdev.c index 2ea588a27c..8271656e84 100644 --- a/drivers/atwinc15x0/atwinc15x0_netdev.c +++ b/drivers/atwinc15x0/atwinc15x0_netdev.c @@ -59,6 +59,7 @@ static void _atwinc15x0_wifi_cb(uint8_t event, void *msg); static void _atwinc15x0_eth_cb(uint8_t type, void *msg, void *ctrl); static int _atwinc15x0_connect(void); +static int _atwinc15x0_init(netdev_t *netdev); static int _set_state(atwinc15x0_t *dev, netopt_state_t state); /** @@ -455,6 +456,10 @@ static int _set_state(atwinc15x0_t *dev, netopt_state_t state) dev->state = state; _atwinc15x0_connect(); return sizeof(netopt_state_t); + case NETOPT_STATE_RESET: + _atwinc15x0_init(&dev->netdev); + dev->state = NETOPT_STATE_IDLE; + return sizeof(netopt_state_t); default: break; }