Skip to content

Commit dec4ce3

Browse files
committed
Potential fix for infinite WiFi loop
1 parent e3e28c1 commit dec4ce3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,9 +1185,8 @@ void networkInterfaceInternetConnectionAvailable(NetIndex_t index)
11851185
// Avoids an infinite start/stop loop
11861186
if (networkSeqStopping & bitMask)
11871187
{
1188-
// if (settings.debugNetworkLayer)
1189-
systemPrintf("\r\n !!! %s stop sequencer running, not marking interface online\r\n",
1190-
networkGetNameByIndex(index));
1188+
if (settings.debugNetworkLayer)
1189+
systemPrintf("%s stop sequencer running, not marking interface online\r\n", networkGetNameByIndex(index));
11911190
return;
11921191
}
11931192

@@ -1280,6 +1279,16 @@ void networkInterfaceInternetConnectionLost(NetIndex_t index)
12801279

12811280
// Mark this network as offline
12821281
bitMask = 1 << index;
1282+
1283+
// If we are currently running a start sequence, do nothing
1284+
// Avoids an infinite start/stop loop
1285+
if (networkSeqStarting & bitMask)
1286+
{
1287+
if (settings.debugNetworkLayer)
1288+
systemPrintf("%s start sequencer running, not marking interface offline\r\n", networkGetNameByIndex(index));
1289+
return;
1290+
}
1291+
12831292
networkHasInternet_bm &= ~bitMask;
12841293
if (settings.debugNetworkLayer)
12851294
systemPrintf("%s does NOT have internet access\r\n", networkInterfaceTable[index].name);

0 commit comments

Comments
 (0)