fix(legacy): update sector argument to match flash_erase_sector size

pull/2302/head
Pavol Rusnak 2 years ago committed by matejcik
parent 9261f2ffce
commit 810b34f579

@ -122,7 +122,7 @@ void svc_flash_program(uint32_t size) {
(void)size; (void)size;
assert(!flash_locked); assert(!flash_locked);
} }
void svc_flash_erase_sector(uint16_t sector) { void svc_flash_erase_sector(uint8_t sector) {
assert(!flash_locked); assert(!flash_locked);
assert(sector >= FLASH_STORAGE_SECTOR_FIRST && assert(sector >= FLASH_STORAGE_SECTOR_FIRST &&
sector <= FLASH_STORAGE_SECTOR_LAST); sector <= FLASH_STORAGE_SECTOR_LAST);

@ -45,7 +45,7 @@ static void svhandler_flash_program(uint32_t psize) {
FLASH_CR |= FLASH_CR_PG; 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. */ /* we only allow erasing storage sectors 2 and 3. */
if (sector < FLASH_STORAGE_SECTOR_FIRST || if (sector < FLASH_STORAGE_SECTOR_FIRST ||
sector > FLASH_STORAGE_SECTOR_LAST) { sector > FLASH_STORAGE_SECTOR_LAST) {

@ -87,7 +87,7 @@ inline void svc_reboot_to_bootloader(void) {
extern void svc_flash_unlock(void); extern void svc_flash_unlock(void);
extern void svc_flash_program(uint32_t program_size); 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_flash_lock(void);
extern uint32_t svc_timer_ms(void); extern uint32_t svc_timer_ms(void);

Loading…
Cancel
Save