From f1a12822d4e4d8aa232b493c6cbf110a5d6f10a8 Mon Sep 17 00:00:00 2001 From: armink Date: Wed, 16 Sep 2015 19:10:39 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E5=AE=8C=E5=96=84=E3=80=91F?= =?UTF-8?q?lash=20Log=E5=8A=9F=E8=83=BD=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=9C=A8=E6=9E=81=E7=AB=AF=E6=83=85=E5=86=B5=E4=B8=8B=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E8=B5=B7=E5=A7=8B=E5=9C=B0=E5=9D=80=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- easyflash/inc/easyflash.h | 2 +- easyflash/src/ef_log.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/easyflash/inc/easyflash.h b/easyflash/inc/easyflash.h index 0daedcb..dff426f 100644 --- a/easyflash/inc/easyflash.h +++ b/easyflash/inc/easyflash.h @@ -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; diff --git a/easyflash/src/ef_log.c b/easyflash/src/ef_log.c index 187df82..088af3f 100644 --- a/easyflash/src/ef_log.c +++ b/easyflash/src/ef_log.c @@ -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: