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
This commit is contained in:
Frank Voorburg 2018-09-29 10:50:21 +00:00
parent c72fff6279
commit a980fe7274
1 changed files with 21 additions and 0 deletions

View File

@ -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.