1、【完善】Flash Log功能,避免在极端情况下出现起始地址无法获取的问题。

Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
armink 2015-09-16 19:10:39 +08:00
parent 332632864e
commit f1a12822d4
2 changed files with 7 additions and 2 deletions

View File

@ -67,7 +67,7 @@ if (!(EXPR)) \
while (1); \
}
/* EasyFlash software version number */
#define EF_SW_VERSION "1.09.12"
#define EF_SW_VERSION "1.09.16"
typedef struct _eflash_env{
char *key;

View File

@ -173,7 +173,12 @@ static void find_start_and_end_addr(void) {
log_start_addr = log_area_start_addr;
cur_using_sec_addr = log_area_start_addr + cur_size;
} else {
/* state 1 or 2*/
/* like state 2 when the sector is the last one */
if (cur_size + EF_ERASE_MIN_SIZE >= LOG_AREA_SIZE) {
cur_log_sec_state = 2;
log_start_addr = log_area_start_addr + cur_size;
cur_using_sec_addr = log_area_start_addr + cur_size - EF_ERASE_MIN_SIZE;
}
}
break;
case FLASH_SECTOR_FULL: