Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Firmware/RTK_Everywhere/RTK_Everywhere.ino
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,10 @@ SparkFunAppleAccessoryDriver *appleAccessory; // Instantiated by beginAuthCoPro

const char *sdp_service_name = "iAP2";

static const uint8_t UUID_IAP2[] = {0x00, 0x00, 0x00, 0x00, 0xDE, 0xCA, 0xFA, 0xDE, 0xDE, 0xCA, 0xDE, 0xAF, 0xDE, 0xCA, 0xCA, 0xFF};
// UUID: Big-Endian
//static const uint8_t UUID_IAP2[] = {0x00, 0x00, 0x00, 0x00, 0xDE, 0xCA, 0xFA, 0xDE, 0xDE, 0xCA, 0xDE, 0xAF, 0xDE, 0xCA, 0xCA, 0xFF};
// UUID: Little-Endian
static const uint8_t UUID_IAP2[] = {0xFF, 0xCA, 0xCA, 0xDE, 0xAF, 0xDE, 0xCA, 0xDE, 0xDE, 0xFA, 0xCA, 0xDE, 0x00, 0x00, 0x00, 0x00};

#endif

Expand Down
26 changes: 24 additions & 2 deletions Firmware/RTK_Everywhere/menuCommands.ino
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,8 @@ int commandLookupSettingNameSelective(bool inCommands, const char *settingName,
prioritySettingsEnd = findEndOfPrioritySettings();
// If "endOfPrioritySettings" is not found, prioritySettingsEnd will be zero

// Remove one because while rtkSettingsEntries[] contains detectedGnssReceiver, the command table does not
prioritySettingsEnd--;
// Adjust prioritySettingsEnd if needed - depending on platform type
prioritySettingsEnd = adjustEndOfPrioritySettings(prioritySettingsEnd);

// Loop through the valid command entries - starting at prioritySettingsEnd
for (int i = prioritySettingsEnd; i < commandCount; i++)
Expand Down Expand Up @@ -3783,6 +3783,25 @@ int findEndOfPrioritySettings()
return prioritySettingsEnd;
}

int adjustEndOfPrioritySettings(int prioritySettingsEnd)
{
// If prioritySettingsEnd is zero, don't adjust
if (prioritySettingsEnd == 0)
return 0;

int adjustedPrioritySettingsEnd = prioritySettingsEnd;

// Check which of the priority settings are possible on this platform
// Deduct the ones which are not
for (int i = 0; i < prioritySettingsEnd; i++)
{
if (!settingPossibleOnPlatform(i))
adjustedPrioritySettingsEnd--;
}

return adjustedPrioritySettingsEnd;
}

// Allocate and fill the commandIndex table
bool commandIndexFillPossible()
{
Expand Down Expand Up @@ -3860,6 +3879,9 @@ bool commandIndexFill(bool usePossibleSettings)
// If "endOfPrioritySettings" is not found, prioritySettingsEnd will be zero
// and all settings will be sorted. Just like the good old days...

// Adjust prioritySettingsEnd if needed - depending on platform type
prioritySettingsEnd = adjustEndOfPrioritySettings(prioritySettingsEnd);

if (settings.debugSettings || settings.debugCLI)
{
systemPrintf("commandCount %d\r\n", commandCount);
Expand Down
8 changes: 7 additions & 1 deletion Firmware/RTK_Everywhere/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,12 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
// i d i v V i c n r e X
// g s x k 2 c h d d x 2 Type Qual Variable Name

// Detected GNSS Receiver - for Flex. Save / load first so settingAvailableOnPlatform is correct on Flex

// =======================================================================================================
// Priority Settings which are not alphabetized in commandIndex
// =======================================================================================================

// Detected GNSS Receiver - only for Flex. Save / load first so settingAvailableOnPlatform is correct on Flex
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, ALL, 0, tGnssReceiver, 0, & settings.detectedGnssReceiver, "detectedGnssReceiver", },

// Common settings which use the same name on multiple Flex platforms
Expand All @@ -1281,6 +1286,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =

// <--- Insert any new essential "priority" (non-sorted) settings above this line --->

// endOfPrioritySettings is a special 'null' entry which does not appear in commandIndex
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, NON, 0, _bool, 0, nullptr, "endOfPrioritySettings", },

// =======================================================================================================
Expand Down