1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

flash: don't call vTaskDelay() before OS init

PIOS_Flash_Jedec_EraseChip is called during early
init when the table_magic has changed.  This call
happens on CC/CC3D prior to the OS being initialized
so it is not OK to call vTaskDelay() yet.

This was leading to boards locking up (no flashing blue
LED) immediately after jumping to the application when
the table_magic had changed or was being init'd for the
very first time.
This commit is contained in:
Stacey Sheldon 2012-06-24 12:23:34 -04:00
parent d43afddd14
commit 154d971d4d

View File

@ -331,10 +331,10 @@ int32_t PIOS_Flash_Jedec_EraseChip()
// Keep polling when bus is busy too // Keep polling when bus is busy too
int i = 0; int i = 0;
while(PIOS_Flash_Jedec_Busy() != 0) { while(PIOS_Flash_Jedec_Busy() != 0) {
#if defined(PIOS_INCLUDE_FREERTOS) #if defined(FLASH_FREERTOS)
vTaskDelay(1); vTaskDelay(1);
#endif #endif
if ((i++) % 100 == 0) if ((i++) % 10000 == 0)
PIOS_LED_Toggle(PIOS_LED_HEARTBEAT); PIOS_LED_Toggle(PIOS_LED_HEARTBEAT);
} }