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
parent 042ed39464
commit f5f3fc338f

View File

@@ -207,7 +207,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);
}