Skip to content
Snippets Groups Projects
Commit 94931c49 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a bug in the EEPROM module.

parent 5c65e0a5
Branches master
No related tags found
No related merge requests found
# setup # setup
# modified by zerom for WinARM 8/2010 # modified by zerom for WinARM 8/2010
STM32_HAL_PATH=$(HOME)/humanoids/stm32_hal STM32_HAL_PATH=$(HOME)/humanoides/tools/stm32_hal
STM32_LIBRARIES_PATH=$(HOME)/humanoids/stm32_libraries STM32_LIBRARIES_PATH=$(HOME)/humanoides/tools/stm32_libraries
PROJECT_NAME=darwin_firmware PROJECT_NAME=darwin_firmware
#TARGET_FILES=$(wildcard src/*.c) #TARGET_FILES=$(wildcard src/*.c)
......
...@@ -331,22 +331,43 @@ uint16_t EE_VerifyPageFullyErased(uint32_t Address) ...@@ -331,22 +331,43 @@ uint16_t EE_VerifyPageFullyErased(uint32_t Address)
uint16_t addressvalue = 0x5555; uint16_t addressvalue = 0x5555;
/* Check each active page address starting from end */ /* Check each active page address starting from end */
while (Address <= PAGE0_END_ADDRESS) if(Address==PAGE0_BASE_ADDRESS)
{ {
/* Get the current location content to be compared with virtual address */ while (Address <= PAGE0_END_ADDRESS)
addressvalue = (*(__IO uint16_t*)Address); {
/* Get the current location content to be compared with virtual address */
addressvalue = (*(__IO uint16_t*)Address);
/* Compare the read address with the virtual address */ /* Compare the read address with the virtual address */
if (addressvalue != ERASED) if (addressvalue != ERASED)
{
/* In case variable value is read, reset readstatus flag */
readstatus = 0;
break;
}
/* Next address location */
Address = Address + 4;
}
}
else
{
while (Address <= PAGE1_END_ADDRESS)
{ {
/* Get the current location content to be compared with virtual address */
/* In case variable value is read, reset readstatus flag */ addressvalue = (*(__IO uint16_t*)Address);
readstatus = 0;
break; /* Compare the read address with the virtual address */
if (addressvalue != ERASED)
{
/* In case variable value is read, reset readstatus flag */
readstatus = 0;
break;
}
/* Next address location */
Address = Address + 4;
} }
/* Next address location */
Address = Address + 4;
} }
/* Return readstatus value: (0: Page not erased, 1: Page erased) */ /* Return readstatus value: (0: Page not erased, 1: Page erased) */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment