diff --git a/flight/modules/Stabilization/inc/stabilization.h b/flight/modules/Stabilization/inc/stabilization.h index 8314ae97e..44ab8917c 100644 --- a/flight/modules/Stabilization/inc/stabilization.h +++ b/flight/modules/Stabilization/inc/stabilization.h @@ -76,7 +76,7 @@ extern StabilizationData stabSettings; // must be same as eventdispatcher to avoid needing additional mutexes #define CBTASK_PRIORITY CALLBACK_TASK_FLIGHTCONTROL -// outer loop only executes every 4th uavobject update to safe CPU +// outer loop only executes every 4th uavobject update to save CPU #define OUTERLOOP_SKIPCOUNT 4 #endif // STABILIZATION_H diff --git a/flight/modules/Stabilization/outerloop.c b/flight/modules/Stabilization/outerloop.c index 7d865b556..7fc5aa4f5 100644 --- a/flight/modules/Stabilization/outerloop.c +++ b/flight/modules/Stabilization/outerloop.c @@ -286,10 +286,10 @@ static void stabilizationOuterloopTask() static void AttitudeStateUpdatedCb(__attribute__((unused)) UAVObjEvent *ev) { - // to reduce CPU utilisation, outer loop is not executed every state update - static uint8_t cpusafer = 0; + // to reduce CPU utilization, outer loop is not executed on every state update + static uint8_t cpusaver = 0; - if ((cpusafer++ % OUTERLOOP_SKIPCOUNT) == 0) { + if ((cpusaver++ % OUTERLOOP_SKIPCOUNT) == 0) { // this does not need mutex protection as both eventdispatcher and stabi run in same callback task! AttitudeStateGet(&attitude); PIOS_CALLBACKSCHEDULER_Dispatch(callbackHandle);