From 810b34f579d3723dd5627efc79a798d34b34992b Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 8 Mar 2022 10:41:35 +0100 Subject: [PATCH] fix(legacy): update sector argument to match flash_erase_sector size --- legacy/emulator/memory.c | 2 +- legacy/supervise.c | 2 +- legacy/supervise.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/legacy/emulator/memory.c b/legacy/emulator/memory.c index 3cca42c68..b4bca60a5 100644 --- a/legacy/emulator/memory.c +++ b/legacy/emulator/memory.c @@ -122,7 +122,7 @@ void svc_flash_program(uint32_t size) { (void)size; assert(!flash_locked); } -void svc_flash_erase_sector(uint16_t sector) { +void svc_flash_erase_sector(uint8_t sector) { assert(!flash_locked); assert(sector >= FLASH_STORAGE_SECTOR_FIRST && sector <= FLASH_STORAGE_SECTOR_LAST); diff --git a/legacy/supervise.c b/legacy/supervise.c index 85f07b7b7..2a41cb81c 100644 --- a/legacy/supervise.c +++ b/legacy/supervise.c @@ -45,7 +45,7 @@ static void svhandler_flash_program(uint32_t psize) { FLASH_CR |= FLASH_CR_PG; } -static void svhandler_flash_erase_sector(uint16_t sector) { +static void svhandler_flash_erase_sector(uint8_t sector) { /* we only allow erasing storage sectors 2 and 3. */ if (sector < FLASH_STORAGE_SECTOR_FIRST || sector > FLASH_STORAGE_SECTOR_LAST) { diff --git a/legacy/supervise.h b/legacy/supervise.h index c466cad31..7da11190b 100644 --- a/legacy/supervise.h +++ b/legacy/supervise.h @@ -87,7 +87,7 @@ inline void svc_reboot_to_bootloader(void) { extern void svc_flash_unlock(void); extern void svc_flash_program(uint32_t program_size); -extern void svc_flash_erase_sector(uint16_t sector); +extern void svc_flash_erase_sector(uint8_t sector); extern uint32_t svc_flash_lock(void); extern uint32_t svc_timer_ms(void);