mirror of
https://github.com/STMicroelectronics/STM32CubeF1.git
synced 2025-04-26 13:49:04 +08:00
[PROJECTS][NUCLEO-F103RB][EEPROM] Replace hard-coded page end address by a variable in EE_VerifyPageFullyErased()
Fixes issue raised in #11.
This commit is contained in:
parent
c750eab699
commit
4b5805238d
@ -305,11 +305,15 @@ uint16_t EE_Init(void)
|
||||
*/
|
||||
uint16_t EE_VerifyPageFullyErased(uint32_t Address)
|
||||
{
|
||||
uint32_t endAddress;
|
||||
uint32_t readstatus = 1;
|
||||
uint16_t addressvalue = 0x5555;
|
||||
|
||||
/* Compute page end-address */
|
||||
endAddress = (uint32_t)(Address + (PAGE_SIZE - 4U));
|
||||
|
||||
/* Check each active page address starting from end */
|
||||
while (Address <= PAGE0_END_ADDRESS)
|
||||
while (Address <= endAddress)
|
||||
{
|
||||
/* Get the current location content to be compared with virtual address */
|
||||
addressvalue = (*(__IO uint16_t*)Address);
|
||||
@ -699,8 +703,6 @@ static uint16_t EE_PageTransfer(uint16_t VirtAddress, uint16_t Data)
|
||||
return flashstatus;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Return last operation flash status */
|
||||
return flashstatus;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user