Skip to content

Commit 444bb24

Browse files
Remove debug printout warnings (#1091)
Exposed by #1090, remove ugly printf format warnings while in debug mode
1 parent 0e6ca28 commit 444bb24

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

cores/rp2040/Tone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void tone(uint8_t pin, unsigned int frequency, unsigned long duration) {
109109
if (ret > 0) {
110110
newTone->alarm = ret;
111111
} else {
112-
DEBUGCORE("ERROR: Unable to allocate timer for tone(%d, %d, %d)\n",
112+
DEBUGCORE("ERROR: Unable to allocate timer for tone(%d, %d, %lu)\n",
113113
pin, frequency, duration);
114114
}
115115
}

cores/rp2040/wiring_analog.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ extern "C" void analogWriteFreq(uint32_t freq) {
4343
return;
4444
}
4545
if (freq < 100) {
46-
DEBUGCORE("ERROR: analogWriteFreq too low (%d)\n", freq);
46+
DEBUGCORE("ERROR: analogWriteFreq too low (%lu)\n", freq);
4747
analogFreq = 100;
4848
} else if (freq > 10'000'000) {
49-
DEBUGCORE("ERROR: analogWriteFreq too high (%d)\n", freq);
49+
DEBUGCORE("ERROR: analogWriteFreq too high (%lu)\n", freq);
5050
analogFreq = 10'000'000;
5151
} else {
5252
analogFreq = freq;
@@ -64,7 +64,7 @@ extern "C" void analogWriteRange(uint32_t range) {
6464
pwmInitted = 0;
6565
scaleInitted = false;
6666
} else {
67-
DEBUGCORE("ERROR: analogWriteRange out of range (%d)\n", range);
67+
DEBUGCORE("ERROR: analogWriteRange out of range (%lu)\n", range);
6868
}
6969
}
7070

@@ -90,14 +90,14 @@ extern "C" void analogWrite(pin_size_t pin, int val) {
9090
while (((clock_get_hz(clk_sys) / ((float)analogScale * analogFreq)) > 255.0) && (analogScale < 32678)) {
9191
analogWritePseudoScale++;
9292
analogScale *= 2;
93-
DEBUGCORE("Adjusting analogWrite values PS=%d, scale=%d\n", analogWritePseudoScale, analogScale);
93+
DEBUGCORE("Adjusting analogWrite values PS=%d, scale=%lu\n", analogWritePseudoScale, analogScale);
9494
}
9595
// For high frequencies, we need to scale the output max value down to actually hit the frequency target
9696
analogWriteSlowScale = 1;
9797
while (((clock_get_hz(clk_sys) / ((float)analogScale * analogFreq)) < 1.0) && (analogScale >= 6)) {
9898
analogWriteSlowScale++;
9999
analogScale /= 2;
100-
DEBUGCORE("Adjusting analogWrite values SS=%d, scale=%d\n", analogWriteSlowScale, analogScale);
100+
DEBUGCORE("Adjusting analogWrite values SS=%d, scale=%lu\n", analogWriteSlowScale, analogScale);
101101
}
102102
scaleInitted = true;
103103
}

libraries/LittleFS/src/LittleFS.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,14 @@ class LittleFSFileImpl : public FileImpl {
457457
if (_creation) {
458458
int rc = lfs_setattr(_fs->getFS(), _name.get(), 'c', (const void *)&_creation, sizeof(_creation));
459459
if (rc < 0) {
460-
DEBUGV("Unable to set creation time on '%s' to %d\n", _name.get(), _creation);
460+
DEBUGV("Unable to set creation time on '%s' to %lld\n", _name.get(), _creation);
461461
}
462462
}
463463
// Add metadata with last write time
464464
time_t now = _timeCallback();
465465
int rc = lfs_setattr(_fs->getFS(), _name.get(), 't', (const void *)&now, sizeof(now));
466466
if (rc < 0) {
467-
DEBUGV("Unable to set last write time on '%s' to %d\n", _name.get(), now);
467+
DEBUGV("Unable to set last write time on '%s' to %lld\n", _name.get(), now);
468468
}
469469
}
470470
}

libraries/SPI/src/SPI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void SPIClassRP2040::transfer(const void *txbuf, void *rxbuf, size_t count) {
178178
}
179179

180180
void SPIClassRP2040::beginTransaction(SPISettings settings) {
181-
DEBUGSPI("SPI::beginTransaction(clk=%d, bo=%s\n", _spis.getClockFreq(), (_spis.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
181+
DEBUGSPI("SPI::beginTransaction(clk=%lu, bo=%s\n", _spis.getClockFreq(), (_spis.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
182182
if (_initted && settings == _spis) {
183183
DEBUGSPI("SPI: Reusing existing initted SPI\n");
184184
} else {

libraries/Updater/src/Updater.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ bool UpdaterClass::begin(size_t size, int command) {
129129
_command = command;
130130

131131
#ifdef DEBUG_UPDATER
132-
DEBUG_UPDATER.printf_P(PSTR("[begin] _startAddress: 0x%08X (%d)\n"), _startAddress, _startAddress);
132+
DEBUG_UPDATER.printf_P(PSTR("[begin] _startAddress: 0x%08lX (%lu)\n"), _startAddress, _startAddress);
133133
DEBUG_UPDATER.printf_P(PSTR("[begin] _size: 0x%08zX (%zd)\n"), _size, _size);
134134
#endif
135135

@@ -188,7 +188,7 @@ bool UpdaterClass::end(bool evenIfRemaining) {
188188
_fp.read((uint8_t *)&sigLen, sizeof(uint32_t));
189189
}
190190
#ifdef DEBUG_UPDATER
191-
DEBUG_UPDATER.printf_P(PSTR("[Updater] sigLen: %d\n"), sigLen);
191+
DEBUG_UPDATER.printf_P(PSTR("[Updater] sigLen: %lu\n"), sigLen);
192192
#endif
193193
if (sigLen != expectedSigLen) {
194194
_setError(UPDATE_ERROR_SIGN);
@@ -276,7 +276,7 @@ bool UpdaterClass::end(bool evenIfRemaining) {
276276
picoOTA.addFile("firmware.bin");
277277
picoOTA.commit();
278278
#ifdef DEBUG_UPDATER
279-
DEBUG_UPDATER.printf_P(PSTR("Staged: address:0x%08X, size:0x%08zX\n"), _startAddress, _size);
279+
DEBUG_UPDATER.printf_P(PSTR("Staged: address:0x%08lX, size:0x%08zX\n"), _startAddress, _size);
280280
#endif
281281
}
282282

libraries/WiFi/src/WiFiMulti.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ uint8_t WiFiMulti::run(uint32_t to) {
7878
for (int i = 0; i < cnt; i++) {
7979
if (WiFi.RSSI(i) > maxRSSID) {
8080
for (auto j = _list.begin(); j != _list.end(); j++) {
81-
DEBUGV("[WIFIMULTI] Checking for '%s' at %d\n", WiFi.SSID(i), WiFi.RSSI(i));
81+
DEBUGV("[WIFIMULTI] Checking for '%s' at %ld\n", WiFi.SSID(i), WiFi.RSSI(i));
8282
if (!strcmp(j->ssid, WiFi.SSID(i))) {
8383
hit = j;
8484
maxRSSID = WiFi.RSSI(i);

libraries/WiFi/src/include/ClientContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ class ClientContext {
651651

652652
void _error(err_t err) {
653653
(void) err;
654-
DEBUGV(":er %d 0x%08x\r\n", (int) err, (uint32_t) _datasource);
654+
DEBUGV(":er %d 0x%08lx\r\n", (int) err, (uint32_t) _datasource);
655655
tcp_arg(_pcb, nullptr);
656656
tcp_sent(_pcb, nullptr);
657657
tcp_recv(_pcb, nullptr);

0 commit comments

Comments
 (0)