Skip to content

Commit 936c5a6

Browse files
committed
Make compile guards work
1 parent fcc47d7 commit 936c5a6

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

Firmware/RTK_Everywhere/GNSS_ZED.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ GNSS_ZED.ino
77
#ifdef COMPILE_ZED
88

99
extern int NTRIPCLIENT_MS_BETWEEN_GGA;
10+
11+
#ifdef COMPILE_NETWORK
1012
extern NetworkClient *ntripClient;
13+
#endif // COMPILE_NETWORK
14+
1115
extern unsigned long lastGGAPush;
1216

1317
//----------------------------------------

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
int wifiConnectionAttempts; // Count the number of connection attempts between restarts
2121

22+
bool restartWiFi = false; // Restart WiFi if user changes anything
23+
2224
#ifdef COMPILE_WIFI
2325

2426
//----------------------------------------
@@ -51,8 +53,6 @@ static DNSServer dnsServer;
5153

5254
static bool wifiRunning;
5355

54-
bool restartWiFi = false; // Restart WiFi if user changes anything
55-
5656
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
5757
// WiFi Routines
5858
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -421,8 +421,15 @@ int wifiNetworkCount()
421421
//----------------------------------------
422422
void wifiRestart()
423423
{
424-
wifiStop();
425-
wifiStart();
424+
// Restart the AP webserver if we are in that state
425+
if (systemState == STATE_WIFI_CONFIG)
426+
requestChangeState(STATE_WIFI_CONFIG_NOT_STARTED);
427+
else
428+
{
429+
// Restart WiFi if we are not in AP config mode
430+
WIFI_STOP();
431+
wifiStart();
432+
}
426433
}
427434

428435
//----------------------------------------

Firmware/RTK_Everywhere/menuMain.ino

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,15 +342,7 @@ void menuMain()
342342
{
343343
restartWiFi = false;
344344

345-
// Restart the AP webserver if we are in that state
346-
if (systemState == STATE_WIFI_CONFIG)
347-
requestChangeState(STATE_WIFI_CONFIG_NOT_STARTED);
348-
else
349-
{
350-
// Restart WiFi if we are not in AP config mode
351-
WIFI_STOP();
352-
wifiStart();
353-
}
345+
wifiRestart();
354346
}
355347

356348
clearBuffer(); // Empty buffer of any newline chars

0 commit comments

Comments
 (0)