diff --git a/eeprom.c b/eeprom.c index e346332..d4bdfb7 100644 --- a/eeprom.c +++ b/eeprom.c @@ -128,11 +128,11 @@ bool EE_Write(uint16_t VirtualAddress, uint32_t Data) return true; } //########################################################################################################## -bool EE_Reads(uint16_t StartVirtualAddress,uint16_t HowMuchToRead,uint32_t* Data) +bool EE_Reads(uint16_t StartVirtualAddress,uint16_t HowManyToRead,uint32_t* Data) { - if((StartVirtualAddress+HowMuchToRead) > (_EEPROM_FLASH_PAGE_SIZE/4)) + if((StartVirtualAddress+HowManyToRead) > (_EEPROM_FLASH_PAGE_SIZE/4)) return false; - for(uint16_t i=StartVirtualAddress ; i (_EEPROM_FLASH_PAGE_SIZE/4)) + if((StartVirtualAddress+HowManyToWrite) > (_EEPROM_FLASH_PAGE_SIZE/4)) return false; #if (_EEPROM_STORE_BEFOR_ERASE___NEED_MORE_RAM==1) if( EE_Reads(0,(_EEPROM_FLASH_PAGE_SIZE/4),EEPROMPageBackup)==false) @@ -167,7 +167,7 @@ bool EE_Writes(uint16_t StartVirtualAddress,uint16_t HowMuchToWrite,uint32_t* D } #else HAL_FLASH_Unlock(); - for(uint16_t i=0; i