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

LP-382 Use ObjectPersistence UAVO instead of stack hungry UAVObjSave()

This commit is contained in:
Vladimir Zidar 2016-09-01 12:48:44 +02:00
parent 52a9aa37c8
commit 27146b6dcd

View File

@ -64,6 +64,7 @@
#include "stabilizationsettingsbank2.h"
#include "stabilizationsettingsbank3.h"
#include "magstate.h"
#include "objectpersistence.h"
#include "pios_sensors.h"
@ -761,7 +762,14 @@ static void msp_set_pid(struct msp_bridge *m)
FlightStatusArmedGet(&armed);
if (armed == FLIGHTSTATUS_ARMED_DISARMED) {
UAVObjSave(m->current_pid_bank, 0);
ObjectPersistenceData op;
op.ObjectID = UAVObjGetID(m->current_pid_bank);
op.InstanceID = 0;
op.Selection = OBJECTPERSISTENCE_SELECTION_SINGLEOBJECT;
op.Operation = OBJECTPERSISTENCE_OPERATION_SAVE;
ObjectPersistenceSet(&op);
}
}