From c2ec40bebfa334a93eaa866367d0ebd36f870be0 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 24 Oct 2017 13:54:21 +0200 Subject: [PATCH] flash: flash_init returns bool --- embed/trezorhal/flash.c | 5 +++++ embed/trezorhal/flash.h | 4 ++++ embed/unix/flash.c | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/embed/trezorhal/flash.c b/embed/trezorhal/flash.c index 99cdb1b09..60ac1abee 100644 --- a/embed/trezorhal/flash.c +++ b/embed/trezorhal/flash.c @@ -41,6 +41,11 @@ const uint32_t FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT + 1] = { [24] = 0x08200000, // last element - not a valid sector }; +secbool flash_init(void) +{ + return sectrue; +} + secbool flash_unlock(void) { HAL_FLASH_Unlock(); diff --git a/embed/trezorhal/flash.h b/embed/trezorhal/flash.h index fea66b296..dbd8bb30f 100644 --- a/embed/trezorhal/flash.h +++ b/embed/trezorhal/flash.h @@ -45,6 +45,10 @@ extern const uint32_t FLASH_SECTOR_TABLE[FLASH_SECTOR_COUNT + 1]; +secbool flash_init(void); + +void flash_set_option_bytes(void); + secbool flash_unlock(void); secbool flash_lock(void); diff --git a/embed/unix/flash.c b/embed/unix/flash.c index 2790660d6..45be5c99b 100644 --- a/embed/unix/flash.c +++ b/embed/unix/flash.c @@ -64,11 +64,11 @@ static void flash_read(void) } } -int flash_init(void) +bool flash_init(void) { memset(flash_buffer, 0xFF, sizeof(flash_buffer)); flash_read(); - return 0; + return true; } void flash_set_option_bytes(void)