From b499312b41b1242ea0670f9ca3dda3be59fd8aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nima=20Askari=20-----=20=D9=86=DB=8C=D9=85=D8=A7=20=D8=B9?= =?UTF-8?q?=D8=B3=DA=A9=D8=B1=DB=8C?= Date: Sat, 11 Jan 2020 12:55:19 +0330 Subject: [PATCH] V 1.1.0 --- eeprom.c | 17 +++++++++++------ eeprom.h | 5 +++-- 2 files changed, 14 insertions(+), 8 deletions(-) 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