Skip to content

Commit 0391806

Browse files
committed
Update to ESP core v2.0.4. Remove unused vars, increase arrays, remove flash helpers.
1 parent a7ecb8e commit 0391806

File tree

9 files changed

+109
-114
lines changed

9 files changed

+109
-114
lines changed

Firmware/RTK_Surveyor/Form.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void startWebServer()
1414
{
1515
csd_t csd;
1616
sd->card()->readCSD(&csd); //Card Specific Data
17-
sdCardSizeMB = 0.000512 * sdCardCapacity(&csd);
17+
sdCardSizeMB = 0.000512 * sd->card()->sectorCount();
1818
sd->volumeBegin();
1919

2020
//Find available cluster/space

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 95 additions & 96 deletions
Large diffs are not rendered by default.

Firmware/RTK_Surveyor/NtripServer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ void ntripServerProcessRTCM(uint8_t incoming)
347347
struct tm timeinfo = rtc.getTimeStruct();
348348
char timestamp[30];
349349
strftime(timestamp, sizeof(timestamp), "%Y-%m-%d %H:%M:%S", &timeinfo);
350-
Serial.printf("RTCM: %s.%03d\r\n", timestamp, rtc.getMillis());
350+
Serial.printf("RTCM: %s.%03ld\r\n", timestamp, rtc.getMillis());
351351
}
352352
previousMilliseconds = currentMilliseconds;
353353

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ uint8_t activeProfiles = 0; //Bit vector indicating which profiles are active
9393
uint8_t displayProfile; //Range: 0 - (MAX_PROFILE_COUNT - 1)
9494
uint8_t profileNumber = MAX_PROFILE_COUNT; //profileNumber gets set once at boot to save loading time
9595
char profileNames[MAX_PROFILE_COUNT][50]; //Populated based on names found in LittleFS and SD
96-
char settingsFileName[40]; //Contains the %s_Settings_%d.txt with current profile number set
96+
char settingsFileName[60]; //Contains the %s_Settings_%d.txt with current profile number set
9797
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
9898

9999
//Handy library for setting ESP32 system time to GNSS time
@@ -228,7 +228,7 @@ float battChangeRate = 0.0;
228228
#include "src/BluetoothSerial/BluetoothSerial.h"
229229
#endif
230230

231-
char platformPrefix[40] = "Surveyor"; //Sets the prefix for broadcast names
231+
char platformPrefix[55] = "Surveyor"; //Sets the prefix for broadcast names
232232

233233
HardwareSerial serialGNSS(2); //TX on 17, RX on 16
234234

@@ -341,7 +341,7 @@ float lBandEBNO = 0.0; //Used on system status menu
341341
//Global variables
342342
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
343343
uint8_t unitMACAddress[6]; //Use MAC address in BT broadcast and display
344-
char deviceName[30]; //The serial string that is broadcast. Ex: 'Surveyor Base-BC61'
344+
char deviceName[70]; //The serial string that is broadcast. Ex: 'Surveyor Base-BC61'
345345
const byte menuTimeout = 15; //Menus will exit/timeout after this number of seconds
346346
int systemTime_minutes = 0; //Used to test if logging is less than max minutes
347347
uint32_t powerPressedStartTime = 0; //Times how long user has been holding power button, used for power down
@@ -483,9 +483,6 @@ void setup()
483483

484484
void loop()
485485
{
486-
uint32_t delayTime;
487-
488-
489486
if (online.gnss == true)
490487
{
491488
i2cGNSS.checkUblox(); //Regularly poll to get latest data and any RTCM
@@ -756,5 +753,5 @@ void updateRTC()
756753

757754
void printElapsedTime(const char* title)
758755
{
759-
Serial.printf("%s: %d\n\r", title, millis() - startTime);
756+
Serial.printf("%s: %ld\n\r", title, millis() - startTime);
760757
}

Firmware/RTK_Surveyor/States.ino

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ void updateSystemState()
440440
//Get the marks file name
441441
char fileName[32];
442442
bool fileOpen = false;
443-
size_t fileSize;
444443
char markBuffer[100];
445444
bool sdCardWasOnline;
446445
int year;
@@ -483,7 +482,7 @@ void updateSystemState()
483482
// 1 2 3 4 5 6 7 8 9
484483
// 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
485484
strcpy(markBuffer, "Date, Time, Latitude, Longitude, Altitude Meters, SIV, HPA Meters, Battery Level, Voltage\n");
486-
int writeBytes = marksFile->write(markBuffer, strlen(markBuffer));
485+
marksFile->write(markBuffer, strlen(markBuffer));
487486
}
488487
if (fileOpen)
489488
{
@@ -513,7 +512,7 @@ void updateSystemState()
513512
battLevel, battVoltage);
514513

515514
//Write the mark to the file
516-
int writeBytes = marksFile->write(markBuffer, strlen(markBuffer));
515+
marksFile->write(markBuffer, strlen(markBuffer));
517516

518517
// Update the file to create time & date
519518
updateDataFileCreate(marksFile);
@@ -1048,6 +1047,6 @@ void changeState(SystemState newState)
10481047
struct tm timeinfo = rtc.getTimeStruct();
10491048
char s[30];
10501049
strftime(s, sizeof(s), "%Y-%m-%d %H:%M:%S", &timeinfo);
1051-
Serial.printf(", %s.%03d\r\n", s, rtc.getMillis());
1050+
Serial.printf(", %s.%03ld\r\n", s, rtc.getMillis());
10521051
}
10531052
}

Firmware/RTK_Surveyor/Tasks.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ void ButtonCheckTask(void *e)
441441

442442
void idleTask(void *e)
443443
{
444-
uint32_t lastStackPrintTime;
444+
uint32_t lastStackPrintTime = 0;
445445

446446
while (1)
447447
{

Firmware/RTK_Surveyor/menuBase.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void menuBase()
8282

8383
if (!settings.fixedBase) {
8484
Serial.print(F("12) Select survey-in radio: "));
85-
Serial.printf("%s\r\n", settings.ntripServer_StartAtSurveyIn ? F("WiFi") : F("Bluetooth"));
85+
Serial.printf("%s\r\n", settings.ntripServer_StartAtSurveyIn ? "WiFi" : "Bluetooth");
8686
}
8787

8888
Serial.println(F("x) Exit"));

Firmware/RTK_Surveyor/menuMessages.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void beginLogging()
333333
{
334334
if (online.microSD == true && settings.enableLogging == true && online.rtc == true) //We can't create a file until we have date/time
335335
{
336-
char fileName[40] = "";
336+
char fileName[66 + 6 + 40] = "";
337337

338338
if (reuseLastLog == true) //attempt to use previous log
339339
{

Firmware/RTK_Surveyor/menuPP.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void menuPointPerfectKeys()
164164
long expYear;
165165
gpsWeekToWToDate(keyGPSWeek, keyGPSToW, &expDay, &expMonth, &expYear);
166166

167-
Serial.printf("%02d/%02d/%d\n\r", expDay, expMonth, expYear);
167+
Serial.printf("%02ld/%02ld/%ld\n\r", expDay, expMonth, expYear);
168168
}
169169
else
170170
Serial.println("N/A");
@@ -189,7 +189,7 @@ void menuPointPerfectKeys()
189189
long expYear;
190190
gpsWeekToWToDate(keyGPSWeek, keyGPSToW, &expDay, &expMonth, &expYear);
191191

192-
Serial.printf("%02d/%02d/%d\n\r", expDay, expMonth, expYear);
192+
Serial.printf("%02ld/%02ld/%ld\n\r", expDay, expMonth, expYear);
193193
}
194194
else
195195
Serial.println("N/A");

0 commit comments

Comments
 (0)