Skip to content

Commit 18a1503

Browse files
committed
Add state and menu option to set forceKeyAttempt true
1 parent 906d6b6 commit 18a1503

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ void displayUpdate()
398398
paintSystemTest();
399399
break;
400400

401+
case (STATE_KEYS_REQUESTED):
402+
// Do nothing. Quick, fall through state.
403+
break;
404+
401405
case (STATE_ESPNOW_PAIRING_NOT_STARTED):
402406
paintEspNowPairing();
403407
break;

Firmware/RTK_Everywhere/States.ino

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,12 @@ void stateUpdate()
502502
}
503503
break;
504504

505+
case (STATE_KEYS_REQUESTED): {
506+
forceKeyAttempt = true; // Force a key update
507+
changeState(lastSystemState); // Return to the last system state
508+
}
509+
break;
510+
505511
case (STATE_ESPNOW_PAIRING_NOT_STARTED): {
506512
#ifdef COMPILE_ESPNOW
507513
paintEspNowPairing();
@@ -760,6 +766,9 @@ const char *getState(SystemState state, char *buffer)
760766
case (STATE_PROFILE):
761767
return "STATE_PROFILE";
762768

769+
case (STATE_KEYS_REQUESTED):
770+
return "STATE_KEYS_REQUESTED";
771+
763772
case (STATE_ESPNOW_PAIRING_NOT_STARTED):
764773
return "STATE_ESPNOW_PAIRING_NOT_STARTED";
765774
case (STATE_ESPNOW_PAIRING):
@@ -933,6 +942,10 @@ void constructSetupDisplay(std::vector<setupButton> *buttons)
933942
{
934943
addSetupButton(buttons, "Config", STATE_WIFI_CONFIG_NOT_STARTED);
935944
}
945+
if (settings.enablePointPerfectCorrections)
946+
{
947+
addSetupButton(buttons, "Get Keys", STATE_KEYS_REQUESTED);
948+
}
936949
addSetupButton(buttons, "E-Pair", STATE_ESPNOW_PAIRING_NOT_STARTED);
937950
// If only one active profile do not show any profiles
938951
if (getProfileCount() > 1)

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,11 @@ void menuPointPerfect()
951951
systemPrintln("Enabled");
952952
else
953953
systemPrintln("Disabled");
954+
systemPrint("3) Request Key Update: ");
955+
if (forceKeyAttempt == true)
956+
systemPrintln("Requested");
957+
else
958+
systemPrintln("Not requested");
954959
#endif // COMPILE_NETWORK
955960

956961
systemPrintln("c) Clear the Keys");
@@ -982,6 +987,10 @@ void menuPointPerfect()
982987
if (settings.autoKeyRenewal)
983988
forceKeyAttempt = true; // Force a key update
984989
}
990+
else if (incoming == 3 && pointPerfectIsEnabled())
991+
{
992+
forceKeyAttempt = true; // Force a key update
993+
}
985994
#endif // COMPILE_NETWORK
986995
else if (incoming == 'c' && pointPerfectIsEnabled())
987996
{

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ typedef enum
2626
STATE_TEST,
2727
STATE_TESTING,
2828
STATE_PROFILE,
29+
STATE_KEYS_REQUESTED,
2930
STATE_ESPNOW_PAIRING_NOT_STARTED,
3031
STATE_ESPNOW_PAIRING,
3132
STATE_NTPSERVER_NOT_STARTED,

0 commit comments

Comments
 (0)