Added miss to the acc calibration
This commit is contained in:
parent
e040e35cf6
commit
83c11bd444
@ -163,6 +163,7 @@ bool systemTaskRxCliCheck(uint32_t currentDeltaTime)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: change the name of this task. Could be something like
|
||||||
void systemTaskSerial(void)
|
void systemTaskSerial(void)
|
||||||
{
|
{
|
||||||
static bool readyToCalibrate = true;
|
static bool readyToCalibrate = true;
|
||||||
@ -180,23 +181,30 @@ void systemTaskSerial(void)
|
|||||||
// mpu6000_read_acc_offset(&accelProfile);
|
// mpu6000_read_acc_offset(&accelProfile);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
//If we are ready to accept a new calibration value. You can only perform one calibration until the sticks have been centered once until the next calibration
|
||||||
if(readyToCalibrate)
|
if(readyToCalibrate)
|
||||||
{
|
{
|
||||||
|
//If any calibration is performed set readyToCalibrate to false so it cant just increase indefinitely when holding the sticks in a certain position
|
||||||
if (flags_IsSet_ID(systemFlags_stickLeft_id))
|
if (flags_IsSet_ID(systemFlags_stickLeft_id))
|
||||||
{
|
{
|
||||||
accRollFineTune -= calibrationAmount;
|
accRollFineTune -= calibrationAmount;
|
||||||
|
readyToCalibrate = false;
|
||||||
}
|
}
|
||||||
else if (flags_IsSet_ID(systemFlags_stickRight_id))
|
else if (flags_IsSet_ID(systemFlags_stickRight_id))
|
||||||
{
|
{
|
||||||
accRollFineTune += calibrationAmount;
|
accRollFineTune += calibrationAmount;
|
||||||
|
readyToCalibrate = false;
|
||||||
}
|
}
|
||||||
else if (flags_IsSet_ID(systemFlags_stickUp_id))
|
else if (flags_IsSet_ID(systemFlags_stickUp_id))
|
||||||
{
|
{
|
||||||
accPitchFineTune -= calibrationAmount;
|
accPitchFineTune -= calibrationAmount;
|
||||||
|
readyToCalibrate = false;
|
||||||
}
|
}
|
||||||
else if (flags_IsSet_ID(systemFlags_stickDown_id))
|
else if (flags_IsSet_ID(systemFlags_stickDown_id))
|
||||||
{
|
{
|
||||||
accPitchFineTune += calibrationAmount;
|
accPitchFineTune += calibrationAmount;
|
||||||
|
readyToCalibrate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user