38#ifdef INCLUDE_DEBUG_FUNCTIONS
42 volatile static uint16_t iTestProgress;
43 volatile static uint16_t iTestDelay = 0;
45 volatile float angle=0.0f;
46 volatile static float threshold=0;
61 quaternionPacketType = sfg->pControlSubsystem->QuaternionPacketType;
148 switch (quaternionPacketType) {
151 CurrentQ = sfg->SV_3DOF_G_BASIC.fLPq;
152 qAeqAxB(&(sfg->SV_3DOF_G_BASIC.fLPq), &ftmpq);
157 CurrentQ = sfg->SV_3DOF_B_BASIC.fLPq;
158 qAeqAxB(&(sfg->SV_3DOF_B_BASIC.fLPq), &ftmpq);
163 CurrentQ = sfg->SV_3DOF_Y_BASIC.fq;
164 qAeqAxB(&(sfg->SV_3DOF_Y_BASIC.fq), &ftmpq);
169 CurrentQ = sfg->SV_6DOF_GB_BASIC.fLPq;
170 qAeqAxB(&(sfg->SV_6DOF_GB_BASIC.fLPq), &ftmpq);
175 CurrentQ = sfg->SV_6DOF_GY_KALMAN.fqPl;
176 qAeqAxB(&(sfg->SV_6DOF_GY_KALMAN.fqPl), &ftmpq);
181 CurrentQ = sfg->SV_9DOF_GBY_KALMAN.fqPl;
182 qAeqAxB(&(sfg->SV_9DOF_GBY_KALMAN.fqPl), &ftmpq);
194 switch (iTestProgress) {
203 StartingQ.
q0 = CurrentQ.
q0;
204 StartingQ.
q1 = -1 * CurrentQ.
q1;
205 StartingQ.
q2 = -1 * CurrentQ.
q2;
206 StartingQ.
q3 = -1 * CurrentQ.
q3;
211 qAeqAxB(&CurrentQ, &StartingQ);
213 angle = fmod(fabs(angle), 180.0);
220 if (angle<threshold) iTestProgress=2;
221 if (angle < (0.2 * threshold)) iTestProgress=0;
222 if (iTestDelay>100) iTestProgress=0;