Skip to content

Commit f8029da

Browse files
authored
Merge pull request #116 from LeeLeahy2/mode-switch
Add mode switch options to system menu
2 parents c5d3dca + b959140 commit f8029da

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
@@ -106,6 +106,11 @@ void menuSystem()
106106

107107
Serial.println(F("r) Reset all settings to default"));
108108

109+
// Support mode switching
110+
Serial.println(F("B) Switch to Base mode"));
111+
Serial.println(F("R) Switch to Rover mode"));
112+
Serial.println(F("W) Switch to WiFi Config mode"));
113+
109114
Serial.println(F("x) Exit"));
110115

111116
byte incoming = getByteChoice(menuTimeout); //Timeout after x seconds
@@ -138,6 +143,19 @@ void menuSystem()
138143
Serial.printf("sdCardSemaphore failed to yield, %s line %d\r\n", __FILE__, __LINE__);
139144
}
140145
}
146+
// Support mode switching
147+
else if (incoming == 'B') {
148+
forceSystemStateUpdate = true; //Imediately go to this new state
149+
changeState(STATE_BASE_NOT_STARTED);
150+
}
151+
else if (incoming == 'R') {
152+
forceSystemStateUpdate = true; //Imediately go to this new state
153+
changeState(STATE_ROVER_NOT_STARTED);
154+
}
155+
else if (incoming == 'W') {
156+
forceSystemStateUpdate = true; //Imediately go to this new state
157+
changeState(STATE_WIFI_CONFIG_NOT_STARTED);
158+
}
141159
else if (incoming == 'x')
142160
break;
143161
else if (incoming == STATUS_GETBYTE_TIMEOUT)

0 commit comments

Comments
 (0)