Skip to content

Commit 6d0c2af

Browse files
committed
Add ability to enter test menu via Facet
1 parent c25a131 commit 6d0c2af

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ void beginSystemState()
478478
else if (productVariant == RTK_FACET)
479479
{
480480
systemState = settings.lastState; //Return to system state previous to power down.
481+
if(systemState == STATE_ROVER_NOT_STARTED)
482+
firstRoverStart = true; //Allow user to enter test screen during first rover start
481483

482484
powerBtn = new Button(pin_powerSenseAndControl); //Create the button in memory
483485
}

Firmware/RTK_Surveyor/Buttons.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//User has pressed the power button to turn on the system
22
//Was it an accidental bump or do they really want to turn on?
3-
//Let's make sure they continue to press for two seconds
3+
//Let's make sure they continue to press for 500ms
44
void powerOnCheck()
55
{
66
#ifdef ENABLE_DEVELOPER
@@ -10,7 +10,7 @@ void powerOnCheck()
1010
powerPressedStartTime = millis();
1111
while (digitalRead(pin_powerSenseAndControl) == LOW)
1212
{
13-
delay(100); //Wait for user to stop pressing button.
13+
delay(10);
1414

1515
if (millis() - powerPressedStartTime > 500)
1616
break;

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
const int FIRMWARE_VERSION_MAJOR = 1;
4545
const int FIRMWARE_VERSION_MINOR = 9;
4646

47-
#define COMPILE_WIFI //Comment out to remove all WiFi functionality
48-
#define COMPILE_BT //Comment out to disable all Bluetooth
47+
//#define COMPILE_WIFI //Comment out to remove all WiFi functionality
48+
//#define COMPILE_BT //Comment out to disable all Bluetooth
4949
#define ENABLE_DEVELOPER //Uncomment this line to enable special developer modes (don't check power button at startup)
5050

5151
//Define the RTK board identifier:
@@ -352,6 +352,8 @@ float svinMeanAccuracy = 0;
352352

353353
uint32_t lastSetupMenuChange = 0; //Auto-selects the setup menu option after 1500ms
354354
uint32_t lastTestMenuChange = 0; //Avoids exiting the test menu for at least 1 second
355+
356+
bool firstRoverStart = false; //Used to detect if user is toggling power button at POR to enter test menu
355357
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
356358

357359
void setup()

Firmware/RTK_Surveyor/States.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ void updateSystemState()
5959
displayRoverSuccess(500);
6060

6161
changeState(STATE_ROVER_NO_FIX);
62+
firstRoverStart = false; //Do not allow entry into test menu again
6263
}
6364
break;
6465

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ void ButtonCheckTask(void *e)
292292
forceSystemStateUpdate = true;
293293
requestChangeState(STATE_SHUTDOWN);
294294
}
295-
// else if ((setupBtn != NULL && setupBtn->pressedFor(500)) &&
296-
// (powerBtn != NULL && powerBtn->pressedFor(500)))
297-
// {
298-
// forceSystemStateUpdate = true;
299-
// requestChangeState(STATE_TEST);
300-
// }
301-
else if (powerBtn != NULL && powerBtn->wasReleased())
295+
else if (powerBtn != NULL && systemState == STATE_ROVER_NOT_STARTED && firstRoverStart == true && powerBtn->pressedFor(500))
296+
{
297+
forceSystemStateUpdate = true;
298+
requestChangeState(STATE_TEST);
299+
lastTestMenuChange = millis(); //Avoid exiting test menu for 1s
300+
}
301+
else if (powerBtn != NULL && powerBtn->wasReleased() && firstRoverStart == false)
302302
{
303303
switch (systemState)
304304
{

0 commit comments

Comments
 (0)