Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void setup() {
Serial.write(packet.data(), packet.length());
Serial.println();
//reply to the client
packet.printf("Got %u bytes of data", packet.length());
packet.printf("Got %zu bytes of data", packet.length());
});
//Send unicast
udp.print("Hello Server!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void setup() {
Serial.write(packet.data(), packet.length());
Serial.println();
//reply to the client
packet.printf("Got %u bytes of data", packet.length());
packet.printf("Got %zu bytes of data", packet.length());
});
//Send multicast
udp.print("Hello!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void setup() {
Serial.write(packet.data(), packet.length());
Serial.println();
//reply to the client
packet.printf("Got %u bytes of data", packet.length());
packet.printf("Got %zu bytes of data", packet.length());
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/BLE/examples/Beacon_Scanner/Beacon_Scanner.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks {
);
} else {
Serial.println("Found another manufacturers beacon!");
Serial.printf("strManufacturerData: %d ", dataLength);
Serial.printf("strManufacturerData: %zu ", dataLength);
for (int i = 0; i < dataLength; i++) {
Serial.printf("[%X]", cManufacturerData[i]);
}
Serial.printf("\n");
}
} else {
Serial.printf("Manufacturer data too large (%d bytes), skipping\n", dataLength);
Serial.printf("Manufacturer data too large (%zu bytes), skipping\n", dataLength);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void setup() {
BTAdvertisedDevice *device = btDeviceList->getDevice(i);
Serial.printf(" ----- %s %s %d\n", device->getAddress().toString().c_str(), device->getName().c_str(), device->getRSSI());
std::map<int, std::string> channels = SerialBT.getChannels(device->getAddress());
Serial.printf("scanned for services, found %d\n", channels.size());
Serial.printf("scanned for services, found %zu\n", channels.size());
for (auto const &entry : channels) {
Serial.printf(" channel %d (%s)\n", entry.first, entry.second.c_str());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ SET_LOOP_TASK_STACK_SIZE(16 * 1024); // 16KB
void setup() {
Serial.begin(115200);

Serial.printf("Arduino Stack was set to %d bytes", getArduinoLoopTaskStackSize());
Serial.printf("Arduino Stack was set to %zu bytes", getArduinoLoopTaskStackSize());

// Print unused stack for the task that is running setup()
Serial.printf("\nSetup() - Free Stack Space: %d", uxTaskGetStackHighWaterMark(NULL));
Serial.printf("\nSetup() - Free Stack Space: %zu", uxTaskGetStackHighWaterMark(NULL));
}

void loop() {
delay(1000);

// Print unused stack for the task that is running loop() - the same as for setup()
Serial.printf("\nLoop() - Free Stack Space: %d", uxTaskGetStackHighWaterMark(NULL));
Serial.printf("\nLoop() - Free Stack Space: %zu", uxTaskGetStackHighWaterMark(NULL));
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void setup() {
Serial.begin(115200);

ulp_setup(); // it really only runs on the first ESP32 boot
Serial.printf("\nStarted smooth blink with delay %ld\n", *fadeCycleDelay);
Serial.printf("\nStarted smooth blink with delay %lu\n", *fadeCycleDelay);

// *fadeCycleDelay resides in RTC_SLOW_MEM and persists along deep sleep waking up
// it is used as a delay time parameter for smooth blinking, in the ULP processing code
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void loop() {

// Once data is available, the number of RMT Symbols is stored in rx_num_symbols
// and the received data is copied to my_data
Serial.printf("Got %d RMT symbols\n", rx_num_symbols);
Serial.printf("Got %zu RMT symbols\n", rx_num_symbols);

// Printout the received data plus the original values
for (int i = 0; i < RMT_NUM_EXCHANGED_DATA; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void onReceiveFunction() {
// This is a callback function that will be activated on UART RX events
size_t available = Serial1.available();
received_bytes = received_bytes + available;
Serial.printf("onReceive Callback:: There are %d bytes available: {", available);
Serial.printf("onReceive Callback:: There are %zu bytes available: {", available);
while (available--) {
char c = Serial1.read();
Serial.printf("0x%x='%c'", c, c);
Expand Down Expand Up @@ -126,12 +126,12 @@ void testAndReport(uint8_t fifoFull, bool break_at_the_end) {
dataSent[i] = 'A' + i; // fill it with characters A..Z
}

Serial.printf("\nTesting onReceive for receiving %d bytes at %d baud, using RX FIFO Full = %d.\n", sent_bytes, BAUD, fifoFull);
Serial.printf("\nTesting onReceive for receiving %zu bytes at %d baud, using RX FIFO Full = %d.\n", sent_bytes, BAUD, fifoFull);
Serial.println("onReceive is called on both FIFO Full and RX Timeout events.");
if (break_at_the_end) {
Serial.printf("BREAK event will be sent at the END of the %d bytes\n", sent_bytes);
Serial.printf("BREAK event will be sent at the END of the %zu bytes\n", sent_bytes);
} else {
Serial.printf("BREAK event will be sent at the BEGINNING of the %d bytes\n", sent_bytes);
Serial.printf("BREAK event will be sent at the BEGINNING of the %zu bytes\n", sent_bytes);
}
Serial.flush(); // wait Serial FIFO to be empty and then spend almost no time processing it
Serial1.setRxFIFOFull(fifoFull); // testing different result based on FIFO Full setup
Expand All @@ -150,8 +150,8 @@ void testAndReport(uint8_t fifoFull, bool break_at_the_end) {
// just wait for receiving all byte in the callback...
}

Serial.printf("\nIt has sent %d bytes from Serial1 TX to Serial1 RX\n", sent_bytes);
Serial.printf("onReceive() has read a total of %d bytes\n", received_bytes);
Serial.printf("\nIt has sent %zu bytes from Serial1 TX to Serial1 RX\n", sent_bytes);
Serial.printf("onReceive() has read a total of %zu bytes\n", received_bytes);

Serial1.onReceiveError(NULL); // resets/disables the RX Error callback function for Serial 1
Serial1.onReceive(NULL); // resets/disables the RX callback function for Serial 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void onReceiveFunction(void) {
// This is a callback function that will be activated on UART RX events
size_t available = Serial1.available();
received_bytes = received_bytes + available;
Serial.printf("onReceive Callback:: There are %d bytes available: ", available);
Serial.printf("onReceive Callback:: There are %zu bytes available: ", available);
while (available--) {
Serial.print((char)Serial1.read());
}
Expand Down Expand Up @@ -106,7 +106,7 @@ void testAndReport(uint8_t fifoFull, bool onlyOnTimeOut) {
dataSent[i] = 'A' + i; // fill it with characters A..Z
}

Serial.printf("\nTesting onReceive for receiving %d bytes at %d baud, using RX FIFO Full = %d.\n", sent_bytes, BAUD, fifoFull);
Serial.printf("\nTesting onReceive for receiving %zu bytes at %d baud, using RX FIFO Full = %d.\n", sent_bytes, BAUD, fifoFull);
if (onlyOnTimeOut) {
Serial.println("onReceive is called just on RX Timeout!");
} else {
Expand All @@ -122,8 +122,8 @@ void testAndReport(uint8_t fifoFull, bool onlyOnTimeOut) {
// just wait for receiving all byte in the callback...
}

Serial.printf("\nIt has sent %d bytes from Serial1 TX to Serial1 RX\n", sent_bytes);
Serial.printf("onReceive() has read a total of %d bytes\n", received_bytes);
Serial.printf("\nIt has sent %zu bytes from Serial1 TX to Serial1 RX\n", sent_bytes);
Serial.printf("onReceive() has read a total of %zu bytes\n", received_bytes);
Serial.println("========================\nFinished!");

Serial1.onReceive(NULL); // resets/disables the RX callback function for Serial 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void testAndReport(uint8_t fifoFull) {
}

uint32_t pastTime = millis() - now; // codespell:ignore pasttime
Serial.printf("\nIt has sent %d bytes from Serial1 TX to Serial1 RX\n", sentBytes);
Serial.printf("\nIt has sent %zu bytes from Serial1 TX to Serial1 RX\n", sentBytes);
Serial.printf("It took %lu milliseconds to read %d bytes\n", pastTime, bytesReceived); // codespell:ignore pasttime
Serial.printf("Per execution Serial.read() number of bytes data and time information:\n");
for (i = 0; i < DATA_SIZE; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void testAndReport(uint8_t rxTimeout) {
}

uint32_t pastTime = millis() - now; // codespell:ignore pasttime
Serial.printf("\nIt has sent %d bytes from Serial1 TX to Serial1 RX\n", sentBytes);
Serial.printf("\nIt has sent %zu bytes from Serial1 TX to Serial1 RX\n", sentBytes);
Serial.printf("It took %lu milliseconds to read %d bytes\n", pastTime, bytesReceived); // codespell:ignore pasttime
Serial.print("Received data: [");
Serial.write(dataReceived, DATA_SIZE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void loop() {

#if TEST_UART > 0
Serial.println("\n\n==================================");
Serial.printf("Sending %d bytes to UART%d...\n", len, TEST_UART);
Serial.printf("Sending %zu bytes to UART%d...\n", len, TEST_UART);
testingSerial.write(serial_data, len);
#else
// when UART0 is used for testing, it is necessary to send data using the Serial Monitor/Terminal
Expand Down
8 changes: 4 additions & 4 deletions libraries/FFat/examples/FFat_Test/FFat_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void testFileIO(fs::FS &fs, const char *path) {
}
Serial.println("");
end = millis() - start;
Serial.printf("- %u bytes read in %lu ms\r\n", flen, end);
Serial.printf("- %zu bytes read in %lu ms\r\n", flen, end);
file.close();
} else {
Serial.println("- failed to open file for reading");
Expand All @@ -170,8 +170,8 @@ void setup() {
return;
}

Serial.printf("Total space: %10u\n", FFat.totalBytes());
Serial.printf("Free space: %10u\n", FFat.freeBytes());
Serial.printf("Total space: %10zu\n", FFat.totalBytes());
Serial.printf("Free space: %10zu\n", FFat.freeBytes());
listDir(FFat, "/", 0);
writeFile(FFat, "/hello.txt", "Hello ");
appendFile(FFat, "/hello.txt", "World!\r\n");
Expand All @@ -180,7 +180,7 @@ void setup() {
readFile(FFat, "/foo.txt");
deleteFile(FFat, "/foo.txt");
testFileIO(FFat, "/test.txt");
Serial.printf("Free space: %10u\n", FFat.freeBytes());
Serial.printf("Free space: %10zu\n", FFat.freeBytes());
deleteFile(FFat, "/test.txt");
Serial.println("Test complete");
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/HTTPUpdateServer/src/HTTPUpdateServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class HTTPUpdateServer {
} else if (_authenticated && upload.status == UPLOAD_FILE_END && !_updaterError.length()) {
if (Update.end(true)) { //true to set the size to the current progress
if (_serial_output) {
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
Serial.printf("Update Success: %zu\nRebooting...\n", upload.totalSize);
}
} else {
_setUpdaterError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void testFileIO(fs::FS &fs, const char *path) {
}
Serial.println("");
end = millis() - start;
Serial.printf("- %u bytes read in %lu ms\r\n", flen, end);
Serial.printf("- %zu bytes read in %lu ms\r\n", flen, end);
file.close();
} else {
Serial.println("- failed to open file for reading");
Expand Down
2 changes: 1 addition & 1 deletion libraries/SD/examples/SD_Test/SD_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void testFileIO(fs::FS &fs, const char *path) {
len -= toRead;
}
end = millis() - start;
Serial.printf("%u bytes read for %lu ms\n", flen, end);
Serial.printf("%zu bytes read for %lu ms\n", flen, end);
file.close();
} else {
Serial.println("Failed to open file for reading");
Expand Down
2 changes: 1 addition & 1 deletion libraries/SD_MMC/examples/SDMMC_Test/SDMMC_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void testFileIO(fs::FS &fs, const char *path) {
len -= toRead;
}
end = millis() - start;
Serial.printf("%u bytes read for %lu ms\n", flen, end);
Serial.printf("%zu bytes read for %lu ms\n", flen, end);
file.close();
} else {
Serial.println("Failed to open file for reading");
Expand Down
2 changes: 1 addition & 1 deletion libraries/SPIFFS/examples/SPIFFS_Test/SPIFFS_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void testFileIO(fs::FS &fs, const char *path) {
}
Serial.println("");
end = millis() - start;
Serial.printf("- %u bytes read in %lu ms\r\n", flen, end);
Serial.printf("- %zu bytes read in %lu ms\r\n", flen, end);
file.close();
} else {
Serial.println("- failed to open file for reading");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void printProgress(size_t progress, const size_t &size) {
progress = (progress * 100) / size;
progress = (progress > 100 ? 100 : progress); //0-100
if (progress != last_progress) {
Serial.printf("Progress: %d%%\n", progress);
Serial.printf("Progress: %zu%%\n", progress);
last_progress = progress;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void printProgress(size_t progress, size_t size) {
progress = (progress * 100) / size;
progress = (progress > 100 ? 100 : progress); //0-100
if (progress != last_progress) {
Serial.printf("\nProgress: %d%%", progress);
Serial.printf("\nProgress: %zu%%", progress);
last_progress = progress;
}
}
Expand Down Expand Up @@ -167,7 +167,7 @@ void setupHttpUpdateServer() {
}
} else if (upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
Serial.printf("Update Success: %zu\nRebooting...\n", upload.totalSize);
} else {
Update.printError(Serial);
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/Update/examples/OTAWebUpdater/OTAWebUpdater.ino
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void handleUpdate() {
return;
}

Serial.printf("Receiving Update: %s, Size: %d\n", upload.filename.c_str(), fsize);
Serial.printf("Receiving Update: %s, Size: %zu\n", upload.filename.c_str(), fsize);
if (!Update.begin(fsize)) {
otaDone = 0;
Update.printError(Serial);
Expand All @@ -96,7 +96,7 @@ void handleUpdate() {
}
} else if (authenticated && upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) {
Serial.printf("Update Success: %u bytes\nRebooting...\n", upload.totalSize);
Serial.printf("Update Success: %zu bytes\nRebooting...\n", upload.totalSize);
} else {
Serial.printf("%s\n", Update.errorString());
otaDone = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ void performOTAUpdate() {
const size_t signatureSize = 512;
size_t firmwareSize = contentLength - signatureSize;

Serial.printf("Actual firmware size: %d bytes\n", firmwareSize);
Serial.printf("Signature size: %d bytes\n", signatureSize);
Serial.printf("Actual firmware size: %zu bytes\n", firmwareSize);
Serial.printf("Signature size: %zu bytes\n", signatureSize);

// Select hash algorithm
#ifdef USE_SHA256
Expand Down Expand Up @@ -170,7 +170,7 @@ void performOTAUpdate() {
delay(1);
}

Serial.printf("Written: %d bytes\n", written);
Serial.printf("Written: %zu bytes\n", written);

// End the update - this will verify the signature
if (Update.end()) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/WebServer/examples/WebUpdate/WebUpdate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void setup(void) {
}
} else if (authenticated && upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
Serial.printf("Update Success: %zu\nRebooting...\n", upload.totalSize);
} else {
Update.printError(Serial);
}
Expand Down
Loading