From 6db366dc3f41e10768dedf42d66f3335c29eab57 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 16 May 2022 20:25:21 -0400 Subject: [PATCH] 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 --- src/stm32/flash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stm32/flash.c b/src/stm32/flash.c index 42f972d..7c574f6 100644 --- a/src/stm32/flash.c +++ b/src/stm32/flash.c @@ -123,7 +123,7 @@ write_block(uint32_t block_address, uint32_t *data) #endif } -static uint32_t write_count; +static uint32_t page_write_count; // Main block write interface int @@ -148,6 +148,7 @@ flash_write_block(uint32_t block_address, uint32_t *data) } else { need_erase = 1; } + page_write_count++; } else { if (!check_erased(block_address, CONFIG_BLOCK_SIZE)) { 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?! return -3; - write_count++; return 0; } @@ -182,5 +182,5 @@ flash_write_block(uint32_t block_address, uint32_t *data) int flash_complete(void) { - return write_count; + return page_write_count; }