mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
CMS dynamic setup popup menu
Adds a dynamically constructed menu that will appear before the main menu when the user enters CMS if there are any outstanding setup items to complete. Currently only includes entry to calibrate the ACC if required, but provides a framework for other setup reminders as needed. The user can choose to exit this menu without remedying the problems, but the menu will reappear when they next enter CMS. If there are no required setup items then the menu will be skipped and the user will go straight to the main menu.
This commit is contained in:
parent
d733c48b04
commit
265d6dde2b
20 changed files with 247 additions and 78 deletions
|
@ -65,8 +65,9 @@ static char accCalibrationStatus[CALIBRATION_STATUS_MAX_LENGTH];
|
|||
static char baroCalibrationStatus[CALIBRATION_STATUS_MAX_LENGTH];
|
||||
#endif
|
||||
|
||||
static const void *cmsx_CalibrationOnDisplayUpdate(const OSD_Entry *selected)
|
||||
static const void *cmsx_CalibrationOnDisplayUpdate(displayPort_t *pDisp, const OSD_Entry *selected)
|
||||
{
|
||||
UNUSED(pDisp);
|
||||
UNUSED(selected);
|
||||
|
||||
tfp_sprintf(gyroCalibrationStatus, sensors(SENSOR_GYRO) ? gyroIsCalibrationComplete() ? CALIBRATION_STATUS_OK : CALIBRATION_STATUS_WAIT: CALIBRATION_STATUS_OFF);
|
||||
|
@ -131,7 +132,7 @@ static const OSD_Entry menuCalibrateAccEntries[] = {
|
|||
{ NULL, OME_END, NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
static CMS_Menu cmsx_menuCalibrateAcc = {
|
||||
CMS_Menu cmsx_menuCalibrateAcc = {
|
||||
#ifdef CMS_MENU_DEBUG
|
||||
.GUARD_text = "ACCCALIBRATION",
|
||||
.GUARD_type = OME_MENU,
|
||||
|
@ -142,7 +143,7 @@ static CMS_Menu cmsx_menuCalibrateAcc = {
|
|||
.entries = menuCalibrateAccEntries
|
||||
};
|
||||
|
||||
static const void *cmsCalibrateAccMenu(displayPort_t *pDisp, const void *self)
|
||||
const void *cmsCalibrateAccMenu(displayPort_t *pDisp, const void *self)
|
||||
{
|
||||
UNUSED(self);
|
||||
|
||||
|
@ -184,8 +185,10 @@ static CMS_Menu cmsx_menuCalibration = {
|
|||
static char infoGitRev[GIT_SHORT_REVISION_LENGTH + 1];
|
||||
static char infoTargetName[] = __TARGET__;
|
||||
|
||||
static const void *cmsx_FirmwareInit(void)
|
||||
static const void *cmsx_FirmwareInit(displayPort_t *pDisp)
|
||||
{
|
||||
UNUSED(pDisp);
|
||||
|
||||
unsigned i;
|
||||
for (i = 0 ; i < GIT_SHORT_REVISION_LENGTH ; i++) {
|
||||
if (shortGitRevision[i] >= 'a' && shortGitRevision[i] <= 'f') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue