1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +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

@ -136,6 +136,10 @@ PG_REGISTER_WITH_RESET_FN(osdConfig_t, osdConfig, PG_OSD_CONFIG, 6);
// be shown on the the post-flight statistics page.
// If you reorder the stats it's likely that you'll need to make likewise updates
// to the unit tests.
// If adding new stats, please add to the osdStatsNeedAccelerometer() function
// if the statistic utilizes the accelerometer.
//
const osd_stats_e osdStatsDisplayOrder[OSD_STAT_COUNT] = {
OSD_STAT_RTC_DATE_TIME,
OSD_STAT_TIMER_1,
@ -950,4 +954,20 @@ statistic_t *osdGetStats(void)
{
return &stats;
}
#ifdef USE_ACC
// Determine if there are any enabled stats that need
// the ACC (currently only MAX_G_FORCE).
static bool osdStatsNeedAccelerometer(void)
{
return osdStatGetState(OSD_STAT_MAX_G_FORCE);
}
// Check if any enabled elements or stats need the ACC
bool osdNeedsAccelerometer(void)
{
return osdStatsNeedAccelerometer() || osdElementsNeedAccelerometer();
}
#endif // USE_ACC
#endif // USE_OSD