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 @@ -1025,19 +1025,6 @@ void wifiStationUpdate()
1025
1025
// Update the WiFi station state
1026
1026
switch (wifiStationState)
1027
1027
{
1028
- // There are no WiFi station consumers
1029
- case WIFI_STATION_STATE_OFF:
1030
- if (enabled)
1031
- {
1032
- connectionAttempts = 0 ;
1033
- timer = millis ();
1034
- startTimeout = 0 ;
1035
-
1036
- // Start WiFi station
1037
- wifiStationSetState (WIFI_STATION_STATE_RESTART_DELAY);
1038
- }
1039
- break ;
1040
-
1041
1028
// Wait for WiFi station users to release resources before shutting
1042
1029
// down WiFi station
1043
1030
case WIFI_STATION_STATE_WAIT_NO_USERS:
@@ -1097,6 +1084,27 @@ void wifiStationUpdate()
1097
1084
}
1098
1085
break ;
1099
1086
1087
+ // There are no WiFi station consumers
1088
+ case WIFI_STATION_STATE_OFF:
1089
+ // Check for disabled
1090
+ if (!enabled)
1091
+ break ;
1092
+
1093
+ // Reset the restart timeout when off
1094
+ if (wifiStationState == WIFI_STATION_STATE_OFF)
1095
+ {
1096
+ connectionAttempts = 0 ;
1097
+ timer = millis ();
1098
+ startTimeout = 0 ;
1099
+ }
1100
+
1101
+ // Wait for the delay to complete
1102
+ wifiStationSetState (WIFI_STATION_STATE_RESTART_DELAY);
1103
+
1104
+ // |
1105
+ // | Fall through
1106
+ // V
1107
+
1100
1108
// Perform the restart delay
1101
1109
case WIFI_STATION_STATE_RESTART_DELAY:
1102
1110
// Stop WiFi station if necessary
You can’t perform that action at this time.
0 commit comments