Skip to content

Commit 8443240

Browse files
committed
Clean up some warnings
1 parent 5d6807a commit 8443240

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ void paintIPAddress()
19921992
char ipAddress[16];
19931993
snprintf(ipAddress, sizeof(ipAddress), "%s",
19941994
#ifdef COMPILE_ETHERNET
1995-
ETH.localIP().toString());
1995+
ETH.localIP().toString().c_str());
19961996
#else // COMPILE_ETHERNET
19971997
"0.0.0.0");
19981998
#endif // COMPILE_ETHERNET
@@ -2052,7 +2052,7 @@ void displayFullIPAddress(std::vector<iconPropertyBlinking> *iconList) // Bottom
20522052
// Display the IP address when it is available
20532053
if (ipAddress != IPAddress((uint32_t)0))
20542054
{
2055-
snprintf(myAddress, sizeof(myAddress), "%s", ipAddress.toString());
2055+
snprintf(myAddress, sizeof(myAddress), "%s", ipAddress.toString().c_str());
20562056

20572057
oled->setFont(QW_FONT_5X7); // Set font to smallest
20582058
oled->setCursor(0, 55);

Firmware/RTK_Everywhere/NTP.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ bool ntpProcessOneRequest(bool process, const timeval *recTv, const timeval *syn
609609
if (ntpDiag != nullptr)
610610
{
611611
char tmpbuf[128];
612-
snprintf(tmpbuf, sizeof(tmpbuf), "Originate Timestamp (Client Transmit): %u.%06u\r\n",
612+
snprintf(tmpbuf, sizeof(tmpbuf), "Originate Timestamp (Client Transmit): %lu.%06lu\r\n",
613613
packet.transmitTimestampSeconds,
614614
packet.convertFractionToMicros(packet.transmitTimestampFraction));
615615
strlcat(ntpDiag, tmpbuf, ntpDiagSize);
@@ -631,7 +631,7 @@ bool ntpProcessOneRequest(bool process, const timeval *recTv, const timeval *syn
631631
if (ntpDiag != nullptr)
632632
{
633633
char tmpbuf[128];
634-
snprintf(tmpbuf, sizeof(tmpbuf), "Received Timestamp: %u.%06u\r\n",
634+
snprintf(tmpbuf, sizeof(tmpbuf), "Received Timestamp: %lu.%06lu\r\n",
635635
packet.receiveTimestampSeconds,
636636
packet.convertFractionToMicros(packet.receiveTimestampFraction));
637637
strlcat(ntpDiag, tmpbuf, ntpDiagSize);
@@ -649,7 +649,7 @@ bool ntpProcessOneRequest(bool process, const timeval *recTv, const timeval *syn
649649
if (ntpDiag != nullptr)
650650
{
651651
char tmpbuf[128];
652-
snprintf(tmpbuf, sizeof(tmpbuf), "Reference Timestamp (Last Sync): %u.%06u\r\n",
652+
snprintf(tmpbuf, sizeof(tmpbuf), "Reference Timestamp (Last Sync): %lu.%06lu\r\n",
653653
packet.referenceTimestampSeconds,
654654
packet.convertFractionToMicros(packet.referenceTimestampFraction));
655655
strlcat(ntpDiag, tmpbuf, ntpDiagSize);
@@ -677,7 +677,7 @@ bool ntpProcessOneRequest(bool process, const timeval *recTv, const timeval *syn
677677
if (ntpDiag != nullptr)
678678
{
679679
char tmpbuf[128];
680-
snprintf(tmpbuf, sizeof(tmpbuf), "Transmit Timestamp: %u.%06u\r\n",
680+
snprintf(tmpbuf, sizeof(tmpbuf), "Transmit Timestamp: %lu.%06lu\r\n",
681681
packet.transmitTimestampSeconds,
682682
packet.convertFractionToMicros(packet.transmitTimestampFraction));
683683
strlcat(ntpDiag, tmpbuf, ntpDiagSize);

Firmware/RTK_Everywhere/NVM.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void recordSystemSettingsToFile(File *settingsFile)
279279
break;
280280
case _uint32_t: {
281281
uint32_t *ptr = (uint32_t *)rtkSettingsEntries[i].var;
282-
settingsFile->printf("%s=%d\r\n", rtkSettingsEntries[i].name, *ptr);
282+
settingsFile->printf("%s=%lu\r\n", rtkSettingsEntries[i].name, *ptr);
283283
}
284284
break;
285285
case _uint64_t: {

Firmware/RTK_Everywhere/States.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ const char *getState(SystemState state, char *buffer)
683683
return "STATE_DISPLAY_SETUP";
684684
case (STATE_WEB_CONFIG_NOT_STARTED):
685685
return "STATE_WEB_CONFIG_NOT_STARTED";
686+
case (STATE_WEB_CONFIG_WAIT_FOR_NETWORK):
686687
case (STATE_WEB_CONFIG):
687688
return "STATE_WEB_CONFIG";
688689
case (STATE_TEST):

Firmware/RTK_Everywhere/Tasks.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ void handleGnssDataTask(void *e)
16451645
// Record trigger count with Time Of Week of rising edge (ms), Millisecond fraction of Time Of Week of
16461646
// rising edge (ns), and accuracy estimate (ns)
16471647
char eventData[82]; // Max NMEA sentence length is 82
1648-
snprintf(eventData, sizeof(eventData), "%d,%d,%d,%d", triggerCount, triggerTowMsR, triggerTowSubMsR,
1648+
snprintf(eventData, sizeof(eventData), "%lu,%lu,%lu,%lu", triggerCount, triggerTowMsR, triggerTowSubMsR,
16491649
triggerAccEst);
16501650

16511651
char nmeaMessage[82]; // Max NMEA sentence length is 82

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,7 +2438,7 @@ void stringRecord(char *settingsCSV, const char *id, int settingValue)
24382438
void stringRecord(char *settingsCSV, const char *id, uint32_t settingValue)
24392439
{
24402440
char record[100];
2441-
snprintf(record, sizeof(record), "%s,%d,", id, settingValue);
2441+
snprintf(record, sizeof(record), "%s,%lu,", id, settingValue);
24422442
strcat(settingsCSV, record);
24432443
}
24442444

@@ -4129,7 +4129,7 @@ void printAvailableSettings()
41294129

41304130
// Convert int to string
41314131
char batteryChargingPercentStr[3] = {0}; // 45
4132-
snprintf(batteryChargingPercentStr, sizeof(batteryChargingPercentStr), "%0.0f", batteryChargingPercentStr);
4132+
snprintf(batteryChargingPercentStr, sizeof(batteryChargingPercentStr), "%0.0f", batteryChargingPercentPerHour);
41334133

41344134
// Create the settingType based on the length of the firmware version
41354135
char settingType[100];

0 commit comments

Comments
 (0)