Fix: Cast min() arguments to size_t for ESP32-C3 compatibility

Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-05 15:12:46 +00:00
committed by Will Tatam
parent ffc7b66c20
commit c91a39f55c

View File

@@ -211,7 +211,7 @@ static void calculateBootloaderSHA256() {
uint8_t buffer[chunkSize];
for (uint32_t offset = 0; offset < bootloaderSize; offset += chunkSize) {
size_t readSize = min(chunkSize, bootloaderSize - offset);
size_t readSize = min((size_t)(bootloaderSize - offset), chunkSize);
if (esp_flash_read(NULL, buffer, bootloaderOffset + offset, readSize) == ESP_OK) {
mbedtls_sha256_update(&ctx, buffer, readSize);
}