mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-06 16:08:28 -04:00
AP_HAL_ChibiOS: Storage: fix up delay comment
EXPECT_DELAY_MS was used in direct contravention of the comment so it must be okay. Even when it wasn't and the comment was accurate, expecting a delay off the main thread never worked properly anyway.
This commit is contained in:
parent
d758bad64d
commit
9d7024f89e
@ -421,12 +421,7 @@ bool Storage::_flash_erase_sector(uint8_t sector)
|
||||
// erasing a page can take long enough that USB may not initialise properly if it happens
|
||||
// while the host is connecting. Only do a flash erase if we have been up for more than 4s
|
||||
for (uint8_t i=0; i<STORAGE_FLASH_RETRIES; i++) {
|
||||
/*
|
||||
a sector erase stops the whole MCU. We need to setup a long
|
||||
expected delay, and not only when running in the main
|
||||
thread. We can't use EXPECT_DELAY_MS() as it checks we are
|
||||
in the main thread
|
||||
*/
|
||||
// a sector erase stops the whole MCU so set up a long expected delay
|
||||
EXPECT_DELAY_MS(1000);
|
||||
#if AP_FLASH_STORAGE_DOUBLE_PAGE
|
||||
if (hal.flash->erasepage(_flash_page+sector) && hal.flash->erasepage(_flash_page+sector+1)) {
|
||||
|
Loading…
Reference in New Issue
Block a user