From 64e35aedb0f2dd3f1918d983235f7d462d31b0b5 Mon Sep 17 00:00:00 2001 From: armink Date: Thu, 2 May 2019 13:32:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=AD=A3=E3=80=91log=20?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=9C=A8=E5=BC=80=E5=90=AF=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=B6=EF=BC=8C=E5=8F=AF=E8=83=BD=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- easyflash/src/ef_log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easyflash/src/ef_log.c b/easyflash/src/ef_log.c index 6d31d38..9d2b8c6 100644 --- a/easyflash/src/ef_log.c +++ b/easyflash/src/ef_log.c @@ -201,7 +201,7 @@ static uint32_t find_sec_using_end_addr(uint32_t addr) { EF_ASSERT(READ_BUF_SIZE % 4 == 0); /* calculate the sector start and data start address */ - sector_start = addr / EF_ERASE_MIN_SIZE * EF_ERASE_MIN_SIZE; + sector_start = addr & (~(EF_ERASE_MIN_SIZE - 1)); data_start = sector_start + LOG_SECTOR_HEADER_SIZE; /* counts continuous 0xFF which is end of sector */ @@ -384,7 +384,7 @@ static void find_start_and_end_addr(void) { /* find the end address */ log_end_addr = find_sec_using_end_addr(cur_using_sec_addr); } - + } /**