mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
spi_flash_cache_enabled: report correct result in single core mode
This commit is contained in:
@@ -287,6 +287,9 @@ static void IRAM_ATTR spi_flash_restore_cache(uint32_t cpuid, uint32_t saved_sta
|
||||
|
||||
IRAM_ATTR bool spi_flash_cache_enabled()
|
||||
{
|
||||
return DPORT_REG_GET_BIT(DPORT_PRO_CACHE_CTRL_REG, DPORT_PRO_CACHE_ENABLE)
|
||||
&& DPORT_REG_GET_BIT(DPORT_APP_CACHE_CTRL_REG, DPORT_APP_CACHE_ENABLE);
|
||||
bool result = (DPORT_REG_GET_BIT(DPORT_PRO_CACHE_CTRL_REG, DPORT_PRO_CACHE_ENABLE) != 0);
|
||||
#if portNUM_PROCESSORS == 2
|
||||
result = result && (DPORT_REG_GET_BIT(DPORT_APP_CACHE_CTRL_REG, DPORT_APP_CACHE_ENABLE) != 0);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user