1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-22 15:55:48 +03:00

Add ACC_CALIB arming disabled reason if ACC is required but not calibrated

Checks various features, modes, and OSD elements to determine if ACC is needed. Generates an arming disabled warning if ACC calibration has never been completed.
This commit is contained in:
Bruce Luckcuck 2019-10-11 16:43:25 -04:00
parent 2888bdd2b8
commit 565f1f4db5
9 changed files with 122 additions and 1 deletions

View file

@ -36,6 +36,8 @@
Add the mapping from the element ID added in the first step to the function
created in the third step to the osdElementDrawFunction array.
If the new element utilizes the accelerometer, add it to the osdElementsNeedAccelerometer() function.
Finally add a CLI parameter for the new element in cli/settings.c.
*/
@ -1779,4 +1781,27 @@ void osdUpdateAlarms(void)
#endif
}
#ifdef USE_ACC
static bool osdElementIsActive(osd_items_e element)
{
for (unsigned i = 0; i < activeOsdElementCount; i++) {
if (activeOsdElementArray[i] == element) {
return true;
}
}
return false;
}
// Determine if any active elements need the ACC
bool osdElementsNeedAccelerometer(void)
{
return osdElementIsActive(OSD_ARTIFICIAL_HORIZON) ||
osdElementIsActive(OSD_PITCH_ANGLE) ||
osdElementIsActive(OSD_ROLL_ANGLE) ||
osdElementIsActive(OSD_G_FORCE) ||
osdElementIsActive(OSD_FLIP_ARROW);
}
#endif // USE_ACC
#endif // USE_OSD