@@ -27,6 +27,8 @@ const unsigned char* GetResource_VERSION(size_t* len);
27
27
char chipID[20 ];
28
28
char DEFAULT_SSID[32 ];
29
29
30
+ bool useFMSMode = false ;
31
+
30
32
XRPConfiguration config;
31
33
NetworkMode netConfigResult;
32
34
@@ -57,6 +59,11 @@ void writeStatusToDisk() {
57
59
size_t len;
58
60
std::string versionString{reinterpret_cast <const char *>(GetResource_VERSION (&len)), len};
59
61
f.printf (" Version: %s\n " , versionString.c_str ());
62
+
63
+ if (useFMSMode) {
64
+ f.printf (" FMS MODE SELECTED\n\n " );
65
+ }
66
+
60
67
f.printf (" Chip ID: %s\n " , chipID);
61
68
f.printf (" WiFi Mode: %s\n " , netConfigResult == NetworkMode::AP ? " AP" : " STA" );
62
69
if (netConfigResult == NetworkMode::AP) {
@@ -68,6 +75,7 @@ void writeStatusToDisk() {
68
75
}
69
76
70
77
f.printf (" IP Address: %s\n " , WiFi.localIP ().toString ().c_str ());
78
+ f.printf (" MAC Address: %s\n " , WiFi.macAddress ().c_str ());
71
79
f.close ();
72
80
}
73
81
@@ -245,7 +253,6 @@ void updateLoopTime(unsigned long loopStart) {
245
253
_avgLoopTimeUs = (totalTime + loopTime) / _loopTimeMeasurementCount;
246
254
}
247
255
248
-
249
256
void setup () {
250
257
// Generate the default SSID using the flash ID
251
258
pico_unique_board_id_t id_out;
@@ -263,6 +270,14 @@ void setup() {
263
270
264
271
delay (2000 );
265
272
273
+ // SPECIAL FOR XRP PARTY
274
+ // Hold down button until flashing starts to switch into FMS mode
275
+ pinMode (XRP_BUILTIN_BUTTON, INPUT_PULLUP);
276
+ delay (500 );
277
+ if (digitalRead (XRP_BUILTIN_BUTTON) == LOW) {
278
+ useFMSMode = true ;
279
+ }
280
+
266
281
// Read Config
267
282
config = loadConfiguration (DEFAULT_SSID);
268
283
@@ -283,7 +298,8 @@ void setup() {
283
298
WiFi.setHostname (DEFAULT_SSID);
284
299
285
300
// Use configuration information
286
- netConfigResult = configureNetwork (config);
301
+ Serial.printf (" [NET] Use FMS Mode? %s\n " , useFMSMode ? " true" : " false" );
302
+ netConfigResult = configureNetwork (config, useFMSMode);
287
303
Serial.printf (" [NET] Actual WiFi Mode: %s\n " , netConfigResult == NetworkMode::AP ? " AP" : " STA" );
288
304
289
305
// Set up HTTP server routes
@@ -357,6 +373,6 @@ void loop1() {
357
373
if (xrp::rangefinderInitialized ()) {
358
374
xrp::rangefinderPeriodic ();
359
375
}
360
-
376
+
361
377
delay (50 );
362
378
}
0 commit comments