flash: Report pages written from "eof" command

Commit 4d969764 changed the "eof" command to return the number of
blocks instead of the number of pages written.  Report the number of
pages written again.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-05-16 20:25:21 -04:00 committed by Eric Callahan
parent 4d969764f1
commit 6db366dc3f

View File

@ -123,7 +123,7 @@ write_block(uint32_t block_address, uint32_t *data)
#endif #endif
} }
static uint32_t write_count; static uint32_t page_write_count;
// Main block write interface // Main block write interface
int int
@ -148,6 +148,7 @@ flash_write_block(uint32_t block_address, uint32_t *data)
} else { } else {
need_erase = 1; need_erase = 1;
} }
page_write_count++;
} else { } else {
if (!check_erased(block_address, CONFIG_BLOCK_SIZE)) { if (!check_erased(block_address, CONFIG_BLOCK_SIZE)) {
if (memcmp(data, (void*)block_address, CONFIG_BLOCK_SIZE) == 0) if (memcmp(data, (void*)block_address, CONFIG_BLOCK_SIZE) == 0)
@ -174,7 +175,6 @@ flash_write_block(uint32_t block_address, uint32_t *data)
// Failed to write to flash?! // Failed to write to flash?!
return -3; return -3;
write_count++;
return 0; return 0;
} }
@ -182,5 +182,5 @@ flash_write_block(uint32_t block_address, uint32_t *data)
int int
flash_complete(void) flash_complete(void)
{ {
return write_count; return page_write_count;
} }