From 24d9e50c0808aaff47a23b36517958ba9b984f07 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Wed, 1 Aug 2012 02:09:10 -0500 Subject: [PATCH] Based on the selected behavior either apply or save the stabilization settings --- flight/Modules/Autotune/autotune.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flight/Modules/Autotune/autotune.c b/flight/Modules/Autotune/autotune.c index 41e8a9542..1a26115ff 100644 --- a/flight/Modules/Autotune/autotune.c +++ b/flight/Modules/Autotune/autotune.c @@ -288,7 +288,19 @@ static void update_stabilization_settings() break; } } - StabilizationSettingsSet(&stabSettings); + switch(relaySettings.Behavior) { + case RELAYTUNINGSETTINGS_BEHAVIOR_MEASURE: + // Just measure, don't update the stab settings + break; + case RELAYTUNINGSETTINGS_BEHAVIOR_COMPUTE: + StabilizationSettingsSet(&stabSettings); + break; + case RELAYTUNINGSETTINGS_BEHAVIOR_SAVE: + StabilizationSettingsSet(&stabSettings); + UAVObjSave(StabilizationSettingsHandle(), 0); + break; + } + } /**