esp32/esp32c3: Fix MMU pages number calculation error

This commit is contained in:
Dong Heng 2021-11-05 16:20:06 +08:00 committed by Xiang Xiao
parent 3db9549fce
commit a59aae6927
2 changed files with 2 additions and 2 deletions

View file

@ -290,7 +290,7 @@ static int IRAM_ATTR esp32c3_mmap(struct spiflash_map_req_s *req)
}
flash_page = MMU_ADDR2PAGE(req->src_addr);
page_cnt = MMU_BYTES2PAGES(req->size);
page_cnt = MMU_BYTES2PAGES(MMU_ADDR2OFF(req->src_addr) + req->size);
if (start_page + page_cnt < DROM0_PAGES_END)
{

View file

@ -1344,7 +1344,7 @@ static int IRAM_ATTR esp32_mmap(struct esp32_spiflash_s *priv,
}
flash_page = MMU_ADDR2PAGE(req->src_addr);
page_cnt = MMU_BYTES2PAGES(req->size);
page_cnt = MMU_BYTES2PAGES(MMU_ADDR2OFF(req->src_addr) + req->size);
if (start_page + page_cnt < DROM0_PAGES_END)
{