spi_write: use uint32_t for the page iteration counter.
The page counter was using an uint8_t which seems unnecessary and might wrap.
This commit is contained in:
parent
3dbf129fa1
commit
b6fc58b743
1 changed files with 1 additions and 1 deletions
|
@ -133,7 +133,7 @@ static bool IRAM spi_write(uint32_t addr, uint8_t *dst, uint32_t size)
|
|||
|
||||
uint32_t offset = write_bytes_to_page;
|
||||
uint32_t pages_to_write = (size - offset) / sdk_flashchip.page_size;
|
||||
for (uint8_t i = 0; i != pages_to_write; i++) {
|
||||
for (uint32_t i = 0; i < pages_to_write; i++) {
|
||||
if (!spi_write_page(&sdk_flashchip, addr + offset,
|
||||
dst + offset, sdk_flashchip.page_size)) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue