1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

Need to add a small delay after save for the load to work correctly. Odd.

This commit is contained in:
James Cotton 2012-06-03 17:26:10 -05:00
parent e8cf606f16
commit e341a37bd1
2 changed files with 7 additions and 3 deletions

View File

@ -242,7 +242,10 @@ static void objectUpdatedCb(UAVObjEvent * ev)
}
// Save selected instance
retval = UAVObjSave(obj, objper.InstanceID);
// Not sure why this is needed
vTaskDelay(10);
// Verify saving worked
if (retval == 0)
retval = UAVObjLoad(obj, objper.InstanceID);

View File

@ -721,10 +721,11 @@ int32_t UAVObjLoad(UAVObjHandle obj, uint16_t instId)
return -1;
// Fire event on success
if (PIOS_FLASHFS_ObjLoad(obj, instId, instEntry->data) == 0)
int32_t retval;
if ((retval = PIOS_FLASHFS_ObjLoad(obj, instId, instEntry->data)) == 0)
sendEvent(objEntry, instId, EV_UNPACKED);
else
return -1;
return retval;
#endif
#if defined(PIOS_INCLUDE_SDCARD)