Nothing Special / Mbed 2 deprecated 00_eeprom_emulation_f091

Dependencies:   mbed

Revision:
5:aa44afa6ca35
Parent:
4:0545cac4e5f9
Child:
6:669ff12928f9
--- a/eeprom/eeprom.cpp	Fri Sep 23 16:53:39 2016 +0000
+++ b/eeprom/eeprom.cpp	Fri Sep 23 17:44:45 2016 +0000
@@ -330,9 +330,20 @@
 {
   uint32_t readstatus = 1;
   uint16_t addressvalue = 0x5555;
+  uint32_t end_address;
+  
+  if (PAGE0_BASE_ADDRESS==Address)
+  {
+    end_address = PAGE0_END_ADDRESS;
+  }
+  else
+  {
+    end_address = PAGE1_END_ADDRESS;
+  };
+  
     
   /* Check each active page address starting from end */
-  while (Address <= PAGE0_END_ADDRESS)
+  while (Address <= end_address)
   {
     /* Get the current location content to be compared with virtual address */
     addressvalue = (*(__IO uint16_t*)Address);