mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 09:09:10 -04:00
Merge branch 'bugfix/fix_cache_count_flash_pages_patchs_return_wrong_value_v5.1' into 'release/v5.1'
fix(rom): Fix s2 and s3 Cache_Count_Flash_Pages rom function wrapper (v5.1) See merge request espressif/esp-idf!37158
This commit is contained in:
commit
dacb2734b7
@ -21,14 +21,13 @@
|
|||||||
extern uint32_t rom_Cache_Count_Flash_Pages(uint32_t bus, uint32_t * page0_mapped);
|
extern uint32_t rom_Cache_Count_Flash_Pages(uint32_t bus, uint32_t * page0_mapped);
|
||||||
uint32_t Cache_Count_Flash_Pages(uint32_t bus, uint32_t * page0_mapped)
|
uint32_t Cache_Count_Flash_Pages(uint32_t bus, uint32_t * page0_mapped)
|
||||||
{
|
{
|
||||||
uint32_t page0_before_count = *page0_mapped;
|
|
||||||
uint32_t flash_pages = 0;
|
uint32_t flash_pages = 0;
|
||||||
flash_pages = rom_Cache_Count_Flash_Pages(bus, page0_mapped);
|
flash_pages = rom_Cache_Count_Flash_Pages(bus, page0_mapped);
|
||||||
|
|
||||||
/* No page mapped to page0, in this condition, the rom api will return
|
/* No page mapped to page0 yet, in this condition, the rom api will return
|
||||||
* unexpected value + 1.
|
* unexpected value + 1.
|
||||||
*/
|
*/
|
||||||
if (page0_before_count == *page0_mapped) {
|
if (*page0_mapped == 0) {
|
||||||
flash_pages--;
|
flash_pages--;
|
||||||
}
|
}
|
||||||
return flash_pages;
|
return flash_pages;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user