From a5f09478f7887db1407c92b77ab8f4ec411384cd Mon Sep 17 00:00:00 2001 From: jaffer Date: Sat, 10 Dec 2022 17:33:52 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8Dlog=20index2addr=20?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=E5=AE=9E=E9=99=85=E7=89=A9=E7=90=86=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E7=A9=BA=E9=97=B4=E9=A3=8E=E9=99=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jaffer --- easyflash/src/ef_log.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/easyflash/src/ef_log.c b/easyflash/src/ef_log.c index c6e8718..49e9d7c 100644 --- a/easyflash/src/ef_log.c +++ b/easyflash/src/ef_log.c @@ -463,8 +463,7 @@ static uint32_t log_index2addr(size_t index) { if (log_start_addr + index + header_total_offset < log_area_start_addr + LOG_AREA_SIZE) { return log_start_addr + index + header_total_offset; } else { - return log_start_addr + index + header_total_offset - LOG_AREA_SIZE; - + return (log_start_addr + index + header_total_offset) % LOG_AREA_SIZE; } } }