From 3994dc6de320f6a224c4ac2a09489a7bcf173596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Quentin?= Date: Fri, 3 Jan 2025 15:53:56 +0100 Subject: [PATCH] Change code for clarity --- esp-hal/src/soc/esp32s3/psram.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esp-hal/src/soc/esp32s3/psram.rs b/esp-hal/src/soc/esp32s3/psram.rs index f9c9606d7..fb2c2973f 100644 --- a/esp-hal/src/soc/esp32s3/psram.rs +++ b/esp-hal/src/soc/esp32s3/psram.rs @@ -174,11 +174,11 @@ pub(crate) fn init_psram(config: PsramConfig) { let mut mapped_pages = 0; for i in (0..FLASH_MMU_TABLE_SIZE).rev() { if mmu_table_ptr.add(i).read_volatile() != MMU_INVALID { - mapped_pages = i; + mapped_pages = (i + 1) as u32; break; } } - let start = EXTMEM_ORIGIN + MMU_PAGE_SIZE * (mapped_pages + 1) as u32; + let start = EXTMEM_ORIGIN + (MMU_PAGE_SIZE * mapped_pages); debug!("PSRAM start address = {:x}", start); // Configure the mode of instruction cache : cache size, cache line size. @@ -188,7 +188,7 @@ pub(crate) fn init_psram(config: PsramConfig) { CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE, ); - // If we need use SPIRAM, we should use data cache.Connfigure the mode of data : + // If we need use SPIRAM, we should use data cache.Configure the mode of data : // cache size, cache line size. Cache_Suspend_DCache();