File tree Expand file tree Collapse file tree 1 file changed +21
-13
lines changed Expand file tree Collapse file tree 1 file changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -979,19 +979,6 @@ void wifiStationUpdate()
979
979
// Update the WiFi station state
980
980
switch (wifiStationState)
981
981
{
982
- // There are no WiFi station consumers
983
- case WIFI_STATION_STATE_OFF:
984
- if (enabled)
985
- {
986
- connectionAttempts = 0 ;
987
- timer = millis ();
988
- startTimeout = 0 ;
989
-
990
- // Start WiFi station
991
- wifiStationSetState (WIFI_STATION_STATE_RESTART_DELAY);
992
- }
993
- break ;
994
-
995
982
// Wait for WiFi station users to release resources before shutting
996
983
// down WiFi station
997
984
case WIFI_STATION_STATE_WAIT_NO_USERS:
@@ -1051,6 +1038,27 @@ void wifiStationUpdate()
1051
1038
}
1052
1039
break ;
1053
1040
1041
+ // There are no WiFi station consumers
1042
+ case WIFI_STATION_STATE_OFF:
1043
+ // Check for disabled
1044
+ if (!enabled)
1045
+ break ;
1046
+
1047
+ // Reset the restart timeout when off
1048
+ if (wifiStationState == WIFI_STATION_STATE_OFF)
1049
+ {
1050
+ connectionAttempts = 0 ;
1051
+ timer = millis ();
1052
+ startTimeout = 0 ;
1053
+ }
1054
+
1055
+ // Wait for the delay to complete
1056
+ wifiStationSetState (WIFI_STATION_STATE_RESTART_DELAY);
1057
+
1058
+ // |
1059
+ // | Fall through
1060
+ // V
1061
+
1054
1062
// Perform the restart delay
1055
1063
case WIFI_STATION_STATE_RESTART_DELAY:
1056
1064
// Stop WiFi station if necessary
You can’t perform that action at this time.
0 commit comments