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
2 changes: 1 addition & 1 deletion Firmware/RTK_Surveyor/Form.ino
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
else if (strcmp(settingName, "profileName") == 0)
{
strcpy(settings.profileName, settingValueStr);
strcpy(profileNames[profileNumber], settingValueStr);
setProfileName(profileNumber);
}
else if (strcmp(settingName, "profileNumber") == 0)
{
Expand Down
10 changes: 10 additions & 0 deletions Firmware/RTK_Surveyor/NVM.ino
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,16 @@ Serial.printf("profiles: 0x%02x\r\n", profiles);
return (profiles);
}

//Copy the profile name into the array of profile names
void setProfileName(uint8_t ProfileNumber)
{
//Update the name in the array of profile names
strcpy(profileNames[profileNumber], settings.profileName);

//Mark this profile as active
activeProfiles |= 1 << ProfileNumber;
}

//Open the clear text file, scan for 'profileName' and return the string
//Returns true if successfully found tag in file, length may be zero
//Looks at LittleFS first, then SD
Expand Down
6 changes: 2 additions & 4 deletions Firmware/RTK_Surveyor/menuMain.ino
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ void menuUserProfiles()

recordProfileNumber(incoming - 1); //Align to array
profileNumber = incoming - 1;

sprintf(settingsFileName, "/%s_Settings_%d.txt", platformFilePrefix, profileNumber); //Enables Delete Profile
setSettingsFileName(); //Enables Delete Profile

//We need to load these settings from file so that we can record a profile name change correctly
bool responseLFS = loadSystemSettingsFromFileLFS(settingsFileName, &settings);
Expand All @@ -175,8 +174,7 @@ void menuUserProfiles()
Serial.print("Enter new profile name: ");
readLine(settings.profileName, sizeof(settings.profileName), menuTimeoutExtended);
recordSystemSettings(); //We need to update this immediately in case user lists the available profiles again

strcpy(profileNames[profileNumber], settings.profileName); //Update array
setProfileName(profileNumber);
}
else if (incoming == MAX_PROFILE_COUNT + 2)
{
Expand Down