From f05b733434a93573a4c1a01a17bca1e9a82aeed1 Mon Sep 17 00:00:00 2001 From: Cliff Geerdes Date: Sun, 27 Mar 2016 01:34:55 -0400 Subject: [PATCH] LP-76 minor cleanup --- flight/modules/AutoTune/autotune.c | 4 ++-- flight/modules/Stabilization/innerloop.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flight/modules/AutoTune/autotune.c b/flight/modules/AutoTune/autotune.c index edda57854..ed4650026 100644 --- a/flight/modules/AutoTune/autotune.c +++ b/flight/modules/AutoTune/autotune.c @@ -203,6 +203,8 @@ static void AutoTuneTask(__attribute__((unused)) void *parameters) uint32_t lastUpdateTime = 0; // initialization is only for compiler warning float noise[3] = { 0 }; uint32_t lastTime = 0.0f; + uint32_t measureTime = 0; + uint32_t updateCounter = 0; bool saveSiNeeded = false; bool savePidNeeded = false; @@ -218,9 +220,7 @@ static void AutoTuneTask(__attribute__((unused)) void *parameters) InitSystemIdent(false); while (1) { - static uint32_t updateCounter = 0; uint32_t diffTime; - uint32_t measureTime = 60000; bool doingIdent = false; bool canSleep = true; FlightStatusData flightStatus; diff --git a/flight/modules/Stabilization/innerloop.c b/flight/modules/Stabilization/innerloop.c index f3aafcea1..6fd36b089 100644 --- a/flight/modules/Stabilization/innerloop.c +++ b/flight/modules/Stabilization/innerloop.c @@ -347,9 +347,9 @@ static void stabilizationInnerloopTask() if (PIOS_DELAY_DiffuS(systemIdentTimeVal) / 1000.0f > SYSTEM_IDENT_PERIOD) { const float SCALE_BIAS = 7.1f; - SystemIdentStateData systemIdentState; + SystemIdentStateBetaData systemIdentBeta; - SystemIdentStateGet(&systemIdentState); + SystemIdentStateBetaGet(&systemIdentBeta); systemIdentTimeVal = PIOS_DELAY_GetRaw(); identOffsets[0] = 0.0f; identOffsets[1] = 0.0f; @@ -358,7 +358,7 @@ static void stabilizationInnerloopTask() // why does yaw change twice a cycle and roll/pitch change only once? uint8_t index = ((uint8_t[]) { '\2', '\0', '\2', '\0', '\2', '\1', '\2', '\1' } )[identIteration]; - float scale = expapprox(SCALE_BIAS - SystemIdentStateBetaToArray(systemIdentState.Beta)[index]); + float scale = expapprox(SCALE_BIAS - SystemIdentStateBetaToArray(systemIdentBeta)[index]); if (scale > 0.25f) { scale = 0.25f; }