mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
logfs: load/save UAVOs to specific logfs partition
Now that multiple filesystem partitions are supported, the UAVO manager needs to be specific about which partition to load/save its objects to. Conflicts: flight/targets/CopterControl/System/pios_board.c flight/targets/DiscoveryF4/System/pios_board.c flight/targets/FlyingF3/System/pios_board.c flight/targets/FlyingF4/System/pios_board.c flight/targets/Freedom/System/pios_board.c flight/targets/Quanton/System/pios_board.c flight/targets/RevoMini/System/pios_board.c flight/targets/Revolution/System/pios_board.c flight/uavobjects/uavobjectmanager.c
This commit is contained in:
parent
4f9ce60930
commit
c6485a134c
@ -797,7 +797,7 @@ int32_t UAVObjSave(UAVObjHandle obj_handle, __attribute__((unused)) uint16_t ins
|
|||||||
if (instId != 0)
|
if (instId != 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (PIOS_FLASHFS_ObjSave(0, UAVObjGetID(obj_handle), instId, (uint8_t*) MetaDataPtr((struct UAVOMeta *)obj_handle), UAVObjGetNumBytes(obj_handle)) != 0)
|
if (PIOS_FLASHFS_ObjSave(pios_uavo_settings_fs_id, UAVObjGetID(obj_handle), instId, (uint8_t*) MetaDataPtr((struct UAVOMeta *)obj_handle), UAVObjGetNumBytes(obj_handle)) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
InstanceHandle instEntry = getInstance( (struct UAVOData *)obj_handle, instId);
|
InstanceHandle instEntry = getInstance( (struct UAVOData *)obj_handle, instId);
|
||||||
@ -808,7 +808,7 @@ int32_t UAVObjSave(UAVObjHandle obj_handle, __attribute__((unused)) uint16_t ins
|
|||||||
if (InstanceData(instEntry) == NULL)
|
if (InstanceData(instEntry) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (PIOS_FLASHFS_ObjSave(0, UAVObjGetID(obj_handle), instId, InstanceData(instEntry), UAVObjGetNumBytes(obj_handle)) != 0)
|
if (PIOS_FLASHFS_ObjSave(pios_uavo_settings_fs_id, UAVObjGetID(obj_handle), instId, InstanceData(instEntry), UAVObjGetNumBytes(obj_handle)) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -952,7 +952,7 @@ int32_t UAVObjLoad(UAVObjHandle obj_handle, __attribute__((unused)) uint16_t ins
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// Fire event on success
|
// Fire event on success
|
||||||
if (PIOS_FLASHFS_ObjLoad(0, UAVObjGetID(obj_handle), instId, (uint8_t*) MetaDataPtr((struct UAVOMeta *)obj_handle), UAVObjGetNumBytes(obj_handle)) == 0)
|
if (PIOS_FLASHFS_ObjLoad(pios_uavo_settings_fs_id, UAVObjGetID(obj_handle), instId, (uint8_t*) MetaDataPtr((struct UAVOMeta *)obj_handle), UAVObjGetNumBytes(obj_handle)) == 0)
|
||||||
sendEvent((struct UAVOBase*)obj_handle, instId, EV_UNPACKED);
|
sendEvent((struct UAVOBase*)obj_handle, instId, EV_UNPACKED);
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
@ -1022,7 +1022,7 @@ int32_t UAVObjDelete(UAVObjHandle obj_handle, __attribute__((unused)) uint16_t i
|
|||||||
{
|
{
|
||||||
PIOS_Assert(obj_handle);
|
PIOS_Assert(obj_handle);
|
||||||
#if defined(PIOS_INCLUDE_FLASH_SECTOR_SETTINGS)
|
#if defined(PIOS_INCLUDE_FLASH_SECTOR_SETTINGS)
|
||||||
PIOS_FLASHFS_ObjDelete(0, UAVObjGetID(obj_handle), instId);
|
PIOS_FLASHFS_ObjDelete(pios_uavo_settings_fs_id, UAVObjGetID(obj_handle), instId);
|
||||||
#endif
|
#endif
|
||||||
#if defined(PIOS_USE_SETTINGS_ON_SDCARD)
|
#if defined(PIOS_USE_SETTINGS_ON_SDCARD)
|
||||||
uint8_t filename[14];
|
uint8_t filename[14];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user