1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-19 09:54:15 +01:00

Flash: Add a vTaskDelay when waiting for flash operations to complete to

prevent blocking the bus from accels
This commit is contained in:
James Cotton 2012-01-26 11:26:19 -06:00
parent 7f38d113eb
commit 8b15fdd88b

View File

@ -257,7 +257,8 @@ int32_t PIOS_Flash_Jedec_EraseSector(uint32_t addr)
PIOS_Flash_Jedec_ReleaseBus();
// Keep polling when bus is busy too
while(PIOS_Flash_Jedec_Busy() != 0);
while(PIOS_Flash_Jedec_Busy() != 0)
vTaskDelay(1);
return 0;
}
@ -288,7 +289,8 @@ int32_t PIOS_Flash_Jedec_EraseChip()
PIOS_Flash_Jedec_ReleaseBus();
// Keep polling when bus is busy too
while(PIOS_Flash_Jedec_Busy() != 0);
while(PIOS_Flash_Jedec_Busy() != 0)
vTaskDelay(1);
return 0;
}
@ -340,8 +342,9 @@ int32_t PIOS_Flash_Jedec_WriteData(uint32_t addr, uint8_t * data, uint16_t len)
PIOS_Flash_Jedec_ReleaseBus();
// Keep polling while bus is busy too
while(PIOS_Flash_Jedec_Busy() != 0);
// Keep polling when bus is busy too
while(PIOS_Flash_Jedec_Busy() != 0)
vTaskDelay(1);
return 0;
}