Skip to content

Commit c08f823

Browse files
committed
Whitespace
1 parent 391f70b commit c08f823

File tree

3 files changed

+71
-56
lines changed

3 files changed

+71
-56
lines changed

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
#include <NetworkUdp.h>
147147
#endif // COMPILE_NETWORK
148148

149-
#define RTK_MAX_CONNECTION_MSEC (15 * MILLISECONDS_IN_A_MINUTE)
149+
#define RTK_MAX_CONNECTION_MSEC (15 * MILLISECONDS_IN_A_MINUTE)
150150

151151
bool RTK_CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC =
152152
false; // Flag used by the special build of libmbedtls (libmbedcrypto) to select external memory
@@ -172,16 +172,16 @@ const uint16_t HTTPS_PORT = 443;
172172
#include <PPP.h>
173173
#endif // COMPILE_CELLULAR
174174

175-
#include <esp_mac.h> // MAC address support
176175
#include "settings.h"
176+
#include <esp_mac.h> // MAC address support
177177

178178
#define MAX_CPU_CORES 2
179179
#define IDLE_COUNT_PER_SECOND 515400 // Found by empirical sketch
180180
#define IDLE_TIME_DISPLAY_SECONDS 5
181181
#define MAX_IDLE_TIME_COUNT (IDLE_TIME_DISPLAY_SECONDS * IDLE_COUNT_PER_SECOND)
182182

183-
#define HOURS_IN_A_DAY 24L
184-
#define MINUTES_IN_AN_HOUR 60L
183+
#define HOURS_IN_A_DAY 24L
184+
#define MINUTES_IN_AN_HOUR 60L
185185
#define SECONDS_IN_A_MINUTE 60L
186186
#define MILLISECONDS_IN_A_SECOND 1000L
187187
#define MILLISECONDS_IN_A_MINUTE (SECONDS_IN_A_MINUTE * MILLISECONDS_IN_A_SECOND)
@@ -377,8 +377,8 @@ bool wifiSoftApRunning; // False: stopped, True: starting, running, stop
377377
bool wifiStationOnline; // WiFi station started successfully
378378
bool wifiStationRunning; // False: stopped, True: starting, running, stopping
379379

380-
const char * wifiSoftApSsid = "RTK Config";
381-
const char * wifiSoftApPassword = nullptr;
380+
const char *wifiSoftApSsid = "RTK Config";
381+
const char *wifiSoftApPassword = nullptr;
382382

383383
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
384384

@@ -996,7 +996,7 @@ volatile bool deadManWalking;
996996
\
997997
/* Turn on nearly all the debug prints */ \
998998
settings.debugCorrections = true; \
999-
settings.debugGnss = false; \
999+
settings.debugGnss = false; \
10001000
settings.debugHttpClientData = true; \
10011001
settings.debugHttpClientState = true; \
10021002
settings.debugLora = true; \
@@ -1041,7 +1041,7 @@ volatile bool deadManWalking;
10411041
\
10421042
/* Turn on nearly all the debug prints */ \
10431043
settings.debugCorrections = true; \
1044-
settings.debugGnss = false; \
1044+
settings.debugGnss = false; \
10451045
settings.debugHttpClientData = false; \
10461046
settings.debugHttpClientState = true; \
10471047
settings.debugLora = false; \
@@ -1240,8 +1240,8 @@ void setup()
12401240
DMW_b("loadSettings");
12411241
loadSettings(); // Attempt to load settings after SD is started so we can read the settings file if available
12421242

1243-
//DEBUG_NEARLY_EVERYTHING // Debug nearly all the things
1244-
//DEBUG_THE_ESSENTIALS // Debug the essentials - handy for measuring the boot time after a factory reset
1243+
// DEBUG_NEARLY_EVERYTHING // Debug nearly all the things
1244+
// DEBUG_THE_ESSENTIALS // Debug the essentials - handy for measuring the boot time after a factory reset
12451245

12461246
DMW_b("checkArrayDefaults");
12471247
checkArrayDefaults(); // Check for uninitialized arrays that won't be initialized by gnssConfigure

Firmware/RTK_Everywhere/WebServer.ino

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ static const char *const webServerStateNames[] = {
3333
// Macros
3434
//----------------------------------------
3535

36-
#define GET_PAGE(page, type, data) \
37-
webServer->on(page, HTTP_GET, []() { \
38-
String length; \
39-
if (settings.debugWebServer == true) \
40-
Serial.printf("WebServer: Sending %s (%p, %d bytes)\r\n", \
41-
page, (void *)data, sizeof(data)); \
42-
webServer->sendHeader("Content-Encoding", "gzip"); \
43-
length = String(sizeof(data)); \
44-
webServer->sendHeader("Content-Length", length.c_str()); \
45-
webServer->send_P(200, type, (const char *)data, sizeof(data)); \
36+
#define GET_PAGE(page, type, data) \
37+
webServer->on(page, HTTP_GET, []() { \
38+
String length; \
39+
if (settings.debugWebServer == true) \
40+
Serial.printf("WebServer: Sending %s (%p, %d bytes)\r\n", page, (void *)data, sizeof(data)); \
41+
webServer->sendHeader("Content-Encoding", "gzip"); \
42+
length = String(sizeof(data)); \
43+
webServer->sendHeader("Content-Length", length.c_str()); \
44+
webServer->send_P(200, type, (const char *)data, sizeof(data)); \
4645
});
4746

4847
//----------------------------------------
@@ -64,7 +63,7 @@ static int last_ws_fd;
6463

6564
static TaskHandle_t updateWebServerTaskHandle;
6665
static const uint8_t updateWebServerTaskPriority = 0; // 3 being the highest, and 0 being the lowest
67-
static const int webServerTaskStackSize = 4096; // Needs to be large enough to hold the file manager file list
66+
static const int webServerTaskStackSize = 4096; // Needs to be large enough to hold the file manager file list
6867
static const int webSocketStackSize = 8192;
6968

7069
// Inspired by:
@@ -953,13 +952,12 @@ bool webServerAssignResources(int httpPort = 80)
953952

954953
// Starts task for updating webServer with handleClient
955954
if (task.updateWebServerTaskRunning == false)
956-
xTaskCreate(
957-
updateWebServerTask,
958-
"UpdateWebServer", // Just for humans
959-
webServerTaskStackSize, // Stack Size - needs to be large enough to hold the file manager list
960-
nullptr, // Task input parameter
961-
updateWebServerTaskPriority,
962-
&updateWebServerTaskHandle); // Task handle
955+
xTaskCreate(updateWebServerTask,
956+
"UpdateWebServer", // Just for humans
957+
webServerTaskStackSize, // Stack Size - needs to be large enough to hold the file manager list
958+
nullptr, // Task input parameter
959+
updateWebServerTaskPriority,
960+
&updateWebServerTaskHandle); // Task handle
963961

964962
if (settings.debugWebServer == true)
965963
systemPrintln("Web Server: Started");
@@ -1027,7 +1025,7 @@ void webServerReleaseResources()
10271025

10281026
online.webServer = false;
10291027

1030-
webServerStopSockets(); // Release socket resources
1028+
webServerStopSockets(); // Release socket resources
10311029

10321030
if (webServer != nullptr)
10331031
{
@@ -1060,8 +1058,7 @@ void webServerStopSockets()
10601058
// Stop the httpd server
10611059
esp_err_t status = httpd_stop(wsserver);
10621060
if (status != ESP_OK)
1063-
systemPrintf("ERROR: wsserver failed to stop, status: %s!\r\n",
1064-
esp_err_to_name(status));
1061+
systemPrintf("ERROR: wsserver failed to stop, status: %s!\r\n", esp_err_to_name(status));
10651062
wsserver = nullptr;
10661063
}
10671064
}
@@ -1312,25 +1309,34 @@ static esp_err_t ws_handler(httpd_req_t *req)
13121309
}
13131310
if (settings.debugWebServer == true)
13141311
{
1315-
const char * pktType;
1312+
const char *pktType;
13161313
size_t length = ws_pkt.len;
13171314
switch (ws_pkt.type)
13181315
{
1319-
default: pktType = nullptr; break;
1320-
case HTTPD_WS_TYPE_CONTINUE: pktType = "HTTPD_WS_TYPE_CONTINUE"; break;
1321-
case HTTPD_WS_TYPE_TEXT: pktType = "HTTPD_WS_TYPE_TEXT"; break;
1322-
case HTTPD_WS_TYPE_BINARY: pktType = "HTTPD_WS_TYPE_BINARY"; break;
1323-
case HTTPD_WS_TYPE_CLOSE: pktType = "HTTPD_WS_TYPE_CLOSE"; break;
1324-
case HTTPD_WS_TYPE_PING: pktType = "HTTPD_WS_TYPE_PING"; break;
1325-
case HTTPD_WS_TYPE_PONG: pktType = "HTTPD_WS_TYPE_PONG"; break;
1316+
default:
1317+
pktType = nullptr;
1318+
break;
1319+
case HTTPD_WS_TYPE_CONTINUE:
1320+
pktType = "HTTPD_WS_TYPE_CONTINUE";
1321+
break;
1322+
case HTTPD_WS_TYPE_TEXT:
1323+
pktType = "HTTPD_WS_TYPE_TEXT";
1324+
break;
1325+
case HTTPD_WS_TYPE_BINARY:
1326+
pktType = "HTTPD_WS_TYPE_BINARY";
1327+
break;
1328+
case HTTPD_WS_TYPE_CLOSE:
1329+
pktType = "HTTPD_WS_TYPE_CLOSE";
1330+
break;
1331+
case HTTPD_WS_TYPE_PING:
1332+
pktType = "HTTPD_WS_TYPE_PING";
1333+
break;
1334+
case HTTPD_WS_TYPE_PONG:
1335+
pktType = "HTTPD_WS_TYPE_PONG";
1336+
break;
13261337
}
1327-
systemPrintf("Packet: %p, %d bytes, type: %d%s%s%s\r\n",
1328-
ws_pkt.payload,
1329-
length,
1330-
ws_pkt.type,
1331-
pktType ? " (" : "",
1332-
pktType ? pktType : "",
1333-
pktType ? ")" : "");
1338+
systemPrintf("Packet: %p, %d bytes, type: %d%s%s%s\r\n", ws_pkt.payload, length, ws_pkt.type,
1339+
pktType ? " (" : "", pktType ? pktType : "", pktType ? ")" : "");
13341340
if (length > 0x40)
13351341
length = 0x40;
13361342
dumpBuffer(ws_pkt.payload, length);
@@ -1379,7 +1385,7 @@ static const httpd_uri_t ws = {.uri = "/ws",
13791385
//----------------------------------------
13801386
// Display the HTTPD configuration
13811387
//----------------------------------------
1382-
void httpdDisplayConfig(struct httpd_config * config)
1388+
void httpdDisplayConfig(struct httpd_config *config)
13831389
{
13841390
systemPrintf("httpd_config object:\r\n");
13851391
systemPrintf("%10d: task_priority\r\n", config->task_priority);
@@ -1445,8 +1451,7 @@ bool websocketServerStart(void)
14451451
}
14461452

14471453
// Display the failure to start
1448-
systemPrintf("ERROR: wsserver failed to start, status: %s!\r\n",
1449-
esp_err_to_name(status));
1454+
systemPrintf("ERROR: wsserver failed to start, status: %s!\r\n", esp_err_to_name(status));
14501455
return false;
14511456
}
14521457

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,20 @@
1515
#define WIFI_CONNECTION_STABLE_MSEC (15 * MILLISECONDS_IN_A_MINUTE)
1616

1717
static const char *wifiAuthorizationName[] = {
18-
"Open", "WEP", "WPA_PSK", "WPA2_PSK", "WPA_WPA2_PSK", //"ENTERPRISE",
18+
"Open",
19+
"WEP",
20+
"WPA_PSK",
21+
"WPA2_PSK",
22+
"WPA_WPA2_PSK", //"ENTERPRISE",
1923
"WPA2_Enterprise",
20-
"WPA3_PSK", "WPA2_WPA3_PSK", "WAPI_PSK", "OWE", "WPA3_ENT_192",
21-
22-
//Compatible with ESP32 core v3.2.1, 16 reported, 18 listed here:
23-
//https://github.com/espressif/esp-idf/blob/master/components/esp_wifi/include/esp_wifi_types_generic.h#L86
24+
"WPA3_PSK",
25+
"WPA2_WPA3_PSK",
26+
"WAPI_PSK",
27+
"OWE",
28+
"WPA3_ENT_192",
29+
30+
// Compatible with ESP32 core v3.2.1, 16 reported, 18 listed here:
31+
// https://github.com/espressif/esp-idf/blob/master/components/esp_wifi/include/esp_wifi_types_generic.h#L86
2432
//"WPA3_EXT_PSK",
2533
//"WPA3_EXT_PSK_MIXED_MODE",
2634
//"DPP",
@@ -3153,8 +3161,10 @@ void RTK_WIFI::verifyTables()
31533161
// Verify the authorization name table
31543162
if (WIFI_AUTH_MAX != wifiAuthorizationNameEntries)
31553163
{
3156-
//https://github.com/espressif/esp-idf/blob/master/components/esp_wifi/include/esp_wifi_types_generic.h#L86
3157-
systemPrintf("ERROR: Fix wifiAuthorizationName list (%d) to match wifi_auth_mode_t (%d) in esp_wifi_types.h!\r\n", wifiAuthorizationNameEntries, WIFI_AUTH_MAX);
3164+
// https://github.com/espressif/esp-idf/blob/master/components/esp_wifi/include/esp_wifi_types_generic.h#L86
3165+
systemPrintf(
3166+
"ERROR: Fix wifiAuthorizationName list (%d) to match wifi_auth_mode_t (%d) in esp_wifi_types.h!\r\n",
3167+
wifiAuthorizationNameEntries, WIFI_AUTH_MAX);
31583168
reportFatalError("Fix wifiAuthorizationName list to match wifi_auth_mode_t in esp_wifi_types.h!");
31593169
}
31603170

0 commit comments

Comments
 (0)