From a980fe7274177d52be4554ea0565a90cb35bfc24 Mon Sep 17 00:00:00 2001 From: Frank Voorburg Date: Sat, 29 Sep 2018 10:50:21 +0000 Subject: [PATCH] Refs #635. Added FlashGetUserProgBaseAddress() to flash_ecc.c. git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@625 5dc33758-31d5-4daf-9ae8-b24bf3d40d73 --- Target/Source/HCS12/flash_ecc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Target/Source/HCS12/flash_ecc.c b/Target/Source/HCS12/flash_ecc.c index c76a3e6f..3a7c9965 100644 --- a/Target/Source/HCS12/flash_ecc.c +++ b/Target/Source/HCS12/flash_ecc.c @@ -690,6 +690,27 @@ blt_bool FlashDone(void) } /*** end of FlashDone ***/ +/************************************************************************************//** +** \brief Obtains the base address of the flash memory available to the user program. +** This is basically the last address in the flashLayout table converted to +** the physical address on the last page, because this is where the address +** will be in. +** \return Base address. +** +****************************************************************************************/ +blt_addr FlashGetUserProgBaseAddress(void) +{ + blt_addr end_address_global; + blt_addr end_address_physical_page_window; + blt_addr end_address_physical_page_last; + + end_address_global = FLASH_END_ADDRESS + 1; + end_address_physical_page_window = FlashGetPhysAddr(end_address_global); + end_address_physical_page_last = end_address_physical_page_window + FLASH_PAGE_SIZE; + return end_address_physical_page_last; +} /*** end of FlashGetUserProgBaseAddress ***/ + + /************************************************************************************//** ** \brief Copies data currently in flash to the block->data and sets the ** base address.