1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-05 21:52:10 +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

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

View File

@ -721,10 +721,11 @@ int32_t UAVObjLoad(UAVObjHandle obj, uint16_t instId)
return -1; return -1;
// Fire event on success // 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); sendEvent(objEntry, instId, EV_UNPACKED);
else else
return -1; return retval;
#endif #endif
#if defined(PIOS_INCLUDE_SDCARD) #if defined(PIOS_INCLUDE_SDCARD)