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:
parent
042ed39464
commit
f5f3fc338f
@ -207,7 +207,7 @@ static void calculateBootloaderSHA256() {
|
|||||||
uint8_t buffer[chunkSize];
|
uint8_t buffer[chunkSize];
|
||||||
|
|
||||||
for (uint32_t offset = 0; offset < bootloaderSize; offset += 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) {
|
if (esp_flash_read(NULL, buffer, bootloaderOffset + offset, readSize) == ESP_OK) {
|
||||||
mbedtls_sha256_update(&ctx, buffer, readSize);
|
mbedtls_sha256_update(&ctx, buffer, readSize);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user