【修正】log 模块在开启编译优化时,可能运行不正常的问题。

Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
armink 2019-05-02 13:32:33 +08:00
parent 4461259169
commit 64e35aedb0

View File

@ -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);
}
}
/**