Skip to content

Commit b959140

Browse files
committed
Add mode switch options to system menu
Extend the system menu to add: * B) Switch to Base mode * R) Switch to Rover mode * W) Switch to WiFi Config mode
1 parent 81089c1 commit b959140

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ void menuSystem()
9292

9393
Serial.println(F("r) Reset all settings to default"));
9494

95+
// Support mode switching
96+
Serial.println(F("B) Switch to Base mode"));
97+
Serial.println(F("R) Switch to Rover mode"));
98+
Serial.println(F("W) Switch to WiFi Config mode"));
99+
95100
Serial.println(F("x) Exit"));
96101

97102
byte incoming = getByteChoice(menuTimeout); //Timeout after x seconds
@@ -120,6 +125,19 @@ void menuSystem()
120125
xSemaphoreGive(xFATSemaphore);
121126
}
122127
}
128+
// Support mode switching
129+
else if (incoming == 'B') {
130+
forceSystemStateUpdate = true; //Imediately go to this new state
131+
changeState(STATE_BASE_NOT_STARTED);
132+
}
133+
else if (incoming == 'R') {
134+
forceSystemStateUpdate = true; //Imediately go to this new state
135+
changeState(STATE_ROVER_NOT_STARTED);
136+
}
137+
else if (incoming == 'W') {
138+
forceSystemStateUpdate = true; //Imediately go to this new state
139+
changeState(STATE_WIFI_CONFIG_NOT_STARTED);
140+
}
123141
else if (incoming == 'x')
124142
break;
125143
else if (incoming == STATUS_GETBYTE_TIMEOUT)

0 commit comments

Comments
 (0)