mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
nxp/imxrt_common/main:Fix Breakage from a9962dc
This commit is contained in:
parent
9f07f2a076
commit
ec2c91fa90
@ -397,7 +397,7 @@ flash_func_sector_size(unsigned sector)
|
||||
}
|
||||
|
||||
/* imxRT uses Flash lib, not up_progmem so let's stub it here */
|
||||
up_progmem_ispageerased(unsigned sector)
|
||||
ssize_t up_progmem_ispageerased(unsigned sector)
|
||||
{
|
||||
const uint32_t bytes_per_sector = flash_func_sector_size(sector);
|
||||
uint32_t *address = (uint32_t *)(IMXRT_FLEXSPI1_CIPHER_BASE + (sector * bytes_per_sector));
|
||||
@ -432,9 +432,13 @@ flash_func_erase_sector(unsigned sector, bool force)
|
||||
return;
|
||||
}
|
||||
|
||||
if (force || flash_func_is_sector_blank(sector) != 0) {
|
||||
if (force || up_progmem_ispageerased(sector) != 0) {
|
||||
|
||||
struct flexspi_nor_config_s *pConfig = &g_bootConfig;
|
||||
|
||||
const uint32_t bytes_per_sector = flash_func_sector_size(sector);
|
||||
uint32_t *address = (uint32_t *)(IMXRT_FLEXSPI1_CIPHER_BASE + (sector * bytes_per_sector));
|
||||
|
||||
uintptr_t offset = ((uintptr_t) address) - IMXRT_FLEXSPI1_CIPHER_BASE;
|
||||
irqstate_t flags;
|
||||
flags = enter_critical_section();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user