Skip to content

Commit 55d6ae1

Browse files
committed
Merge branch 'release_candidate' of https://github.com/sparkfun/SparkFun_RTK_Firmware into release_candidate
2 parents 05f6015 + 7e9bc43 commit 55d6ae1

File tree

7 files changed

+54
-9
lines changed

7 files changed

+54
-9
lines changed

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ void loadSettings()
2222
//loadSystemSettingsFromFileLFS(settingsFileName, &settings); - Previously loaded during loadSettingsPartial()
2323
loadSystemSettingsFromFileSD(settingsFileName, &settings);
2424

25-
//Change default profile names to 'Profile1' etc
26-
if (strcmp(settings.profileName, "Default") == 0)
25+
//Change empty profile name to 'Profile1' etc
26+
if (strcmp(settings.profileName, "(Empty)") == 0)
2727
sprintf(settings.profileName, "Profile%d", profileNumber + 1);
2828

2929
//Record these settings to LittleFS and SD file to be sure they are the same

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ const char* pointPerfectKeyTopic = "/pp/ubx/0236/Lb";
364364
#if __has_include("tokens.h")
365365
#include "tokens.h"
366366
#else
367-
uint8_t pointPerfectTokenArray = {0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22, 0x33, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03}; //Token in HEX form
367+
uint8_t pointPerfectTokenArray[] = {0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22, 0x33, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03}; //Token in HEX form
368368

369369
static const char *AWS_PUBLIC_CERT = R"=====(
370370
-----BEGIN CERTIFICATE-----

Firmware/RTK_Surveyor/States.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,7 @@ void requestChangeState(SystemState requestedState)
13861386
//Change states and print the new state
13871387
void changeState(SystemState newState)
13881388
{
1389+
reportHeapNow();
13891390
systemState = newState;
13901391

13911392
//Debug print

Firmware/RTK_Surveyor/System.ino

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ void startBluetooth()
6060
#endif
6161

6262
btState = BT_NOTCONNECTED;
63+
reportHeapNow();
6364
}
6465

6566
}
@@ -80,6 +81,7 @@ void stopBluetooth()
8081
log_d("Bluetooth turned off");
8182

8283
btState = BT_OFF;
84+
reportHeapNow();
8385
}
8486
}
8587

@@ -93,6 +95,7 @@ void startWiFi(char* ssid, char* pw)
9395
#endif
9496

9597
wifiState = WIFI_NOTCONNECTED;
98+
reportHeapNow();
9699
}
97100
}
98101

@@ -109,6 +112,7 @@ void stopWiFi()
109112

110113
log_d("WiFi Stopped");
111114
wifiState = WIFI_OFF;
115+
reportHeapNow();
112116
}
113117
}
114118

@@ -576,15 +580,24 @@ bool createTestFile()
576580
return (false);
577581
}
578582

583+
//If debug option is on, print available heap
584+
void reportHeapNow()
585+
{
586+
if (settings.enableHeapReport == true)
587+
{
588+
lastHeapReport = millis();
589+
Serial.printf("FreeHeap: %d / HeapLowestPoint: %d / LargestBlock: %d\n\r", ESP.getFreeHeap(), xPortGetMinimumEverFreeHeapSize(), heap_caps_get_largest_free_block(MALLOC_CAP_8BIT));
590+
}
591+
}
592+
579593
//If debug option is on, print available heap
580594
void reportHeap()
581595
{
582596
if (settings.enableHeapReport == true)
583597
{
584598
if (millis() - lastHeapReport > 1000)
585599
{
586-
lastHeapReport = millis();
587-
Serial.printf("FreeHeap: %d / HeapLowestPoint: %d / LargestBlock: %d\n\r", ESP.getFreeHeap(), xPortGetMinimumEverFreeHeapSize(), heap_caps_get_largest_free_block(MALLOC_CAP_8BIT));
600+
reportHeapNow();
588601
}
589602
}
590603
}

Firmware/RTK_Surveyor/menuMain.ino

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,19 @@ void menuUserProfiles()
124124
for (int x = 0 ; x < MAX_PROFILE_COUNT ; x++)
125125
{
126126
if (strlen(profileNames[x]) > 0)
127-
{
128127
Serial.printf("%d) Select %s", x + 1, profileNames[x]);
129-
if (x == profileNumber) Serial.print(" <- Current");
130-
}
131128
else
132129
Serial.printf("%d) Select (Empty)", x + 1);
133130

131+
if (x == profileNumber) Serial.print(" <- Current");
132+
134133
Serial.println();
135134
}
136135

137136
Serial.printf("%d) Edit profile name: %s\n\r", MAX_PROFILE_COUNT + 1, profileNames[profileNumber]);
138137

138+
Serial.printf("%d) Delete profile '%s'\n\r", MAX_PROFILE_COUNT + 2, profileNames[profileNumber]);
139+
139140
Serial.println(F("x) Exit"));
140141

141142
int incoming = getNumber(menuTimeout); //Timeout after x seconds
@@ -164,6 +165,34 @@ void menuUserProfiles()
164165

165166
strcpy(profileNames[profileNumber], settings.profileName); //Update array
166167
}
168+
else if (incoming == MAX_PROFILE_COUNT + 2)
169+
{
170+
Serial.printf("\r\nDelete profile '%s'. Press 'y' to confirm:", profileNames[profileNumber]);
171+
byte bContinue = getByteChoice(menuTimeout);
172+
if (bContinue == 'y')
173+
{
174+
//Remove profile from LittleFS
175+
if (LittleFS.exists(settingsFileName))
176+
LittleFS.remove(settingsFileName);
177+
178+
//Remove profile from SD if available
179+
if (online.microSD == true)
180+
{
181+
if (sd.exists(settingsFileName))
182+
sd.remove(settingsFileName);
183+
}
184+
185+
//Clear this profile profile with default settings
186+
Settings tempSettings;
187+
settings = tempSettings;
188+
189+
recordSystemSettings();
190+
191+
strcpy(profileNames[profileNumber], settings.profileName); //Update array
192+
}
193+
else
194+
Serial.println(F("Delete aborted"));
195+
}
167196

168197
else if (incoming == STATUS_PRESSED_X)
169198
break;

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ void menuDebug()
289289
}
290290
else if (incoming == 'r')
291291
{
292+
recordSystemSettings();
293+
292294
ESP.restart();
293295
}
294296
else if (incoming == 't')

Firmware/RTK_Surveyor/settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ typedef struct {
336336
};
337337

338338
int maxLogLength_minutes = 60 * 24; //Default to 24 hours
339-
char profileName[50] = "Default";
339+
char profileName[50] = "(Empty)";
340340

341341
//NTRIP Server
342342
bool enableNtripServer = false;

0 commit comments

Comments
 (0)