From 8e987eeaaf8b8577de6c05b3d75a4e32fb922c39 Mon Sep 17 00:00:00 2001 From: Asizon <43983086+Asizon@users.noreply.github.com> Date: Sat, 27 Apr 2019 00:16:33 +0200 Subject: [PATCH 1/2] Add switchable gyro to cms options Applied only to MULTI_GYRO Added forgotten definition --- src/main/cms/cms_menu_imu.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index 970e7afe7..759c1c7ee 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -31,6 +31,7 @@ #ifdef USE_CMS #include "build/version.h" +#include "build/build_config.h" #include "cms/cms.h" #include "cms/cms_types.h" @@ -81,6 +82,12 @@ static const char * const osdTableDynNotchRangeType[] = { }; #endif +#ifdef USE_MULTI_GYRO +static const char * const osdTableGyroToUse[] = { + "FIRST", "SECOND", "BOTH" +}; +#endif + static void setProfileIndexString(char *profileString, int profileIndex, char *profileName) { int charIndex = 0; @@ -327,6 +334,7 @@ static const OSD_Entry cmsx_menuLaunchControlEntries[] = { { "TRIGGER THROTTLE", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_launchControlThrottlePercent, 0, LAUNCH_CONTROL_THROTTLE_TRIGGER_MAX, 1 } , 0 }, { "ANGLE LIMIT", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_launchControlAngleLimit, 0, 80, 1 } , 0 }, { "ITERM GAIN", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_launchControlGain, 0, 200, 1 } , 0 }, + { "BACK", OME_Back, NULL, NULL, 0 }, { NULL, OME_END, NULL, NULL, 0 } }; @@ -466,6 +474,7 @@ static uint16_t gyroConfig_gyro_soft_notch_hz_1; static uint16_t gyroConfig_gyro_soft_notch_cutoff_1; static uint16_t gyroConfig_gyro_soft_notch_hz_2; static uint16_t gyroConfig_gyro_soft_notch_cutoff_2; +static uint8_t gyroConfig_gyro_to_use; static long cmsx_menuGyro_onEnter(void) { @@ -475,6 +484,7 @@ static long cmsx_menuGyro_onEnter(void) gyroConfig_gyro_soft_notch_cutoff_1 = gyroConfig()->gyro_soft_notch_cutoff_1; gyroConfig_gyro_soft_notch_hz_2 = gyroConfig()->gyro_soft_notch_hz_2; gyroConfig_gyro_soft_notch_cutoff_2 = gyroConfig()->gyro_soft_notch_cutoff_2; + gyroConfig_gyro_to_use = gyroConfig()->gyro_to_use; return 0; } @@ -489,6 +499,7 @@ static long cmsx_menuGyro_onExit(const OSD_Entry *self) gyroConfigMutable()->gyro_soft_notch_cutoff_1 = gyroConfig_gyro_soft_notch_cutoff_1; gyroConfigMutable()->gyro_soft_notch_hz_2 = gyroConfig_gyro_soft_notch_hz_2; gyroConfigMutable()->gyro_soft_notch_cutoff_2 = gyroConfig_gyro_soft_notch_cutoff_2; + gyroConfigMutable()->gyro_to_use = gyroConfig_gyro_to_use; return 0; } @@ -505,7 +516,10 @@ static const OSD_Entry cmsx_menuFilterGlobalEntries[] = { "GYRO NF1C", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_cutoff_1, 0, 500, 1 }, 0 }, { "GYRO NF2", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_hz_2, 0, 500, 1 }, 0 }, { "GYRO NF2C", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_cutoff_2, 0, 500, 1 }, 0 }, - +#ifdef USE_MULTI_GYRO + { "GYRO TO USE", OME_TAB, NULL, &(OSD_TAB_t) { &gyroConfig_gyro_to_use, 2, osdTableGyroToUse}, 0 }, +#endif + { "BACK", OME_Back, NULL, NULL, 0 }, { NULL, OME_END, NULL, NULL, 0 } }; @@ -652,6 +666,7 @@ static const OSD_Entry cmsx_menuFilterPerProfileEntries[] = { "DTERM NF", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_notch_hz, 0, 500, 1 }, 0 }, { "DTERM NFCO", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_notch_cutoff, 0, 500, 1 }, 0 }, { "YAW LPF", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_yaw_lowpass_hz, 0, 500, 1 }, 0 }, + { "BACK", OME_Back, NULL, NULL, 0 }, { NULL, OME_END, NULL, NULL, 0 } }; From 22e9c32b84ebc759091fa5992109df2f8852f17b Mon Sep 17 00:00:00 2001 From: Asizon <43983086+Asizon@users.noreply.github.com> Date: Thu, 23 May 2019 00:49:42 +0200 Subject: [PATCH 2/2] Added REBOOT_REQUIRED flag --- src/main/cms/cms_menu_imu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index 759c1c7ee..2d29bf505 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -517,7 +517,7 @@ static const OSD_Entry cmsx_menuFilterGlobalEntries[] = { "GYRO NF2", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_hz_2, 0, 500, 1 }, 0 }, { "GYRO NF2C", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_soft_notch_cutoff_2, 0, 500, 1 }, 0 }, #ifdef USE_MULTI_GYRO - { "GYRO TO USE", OME_TAB, NULL, &(OSD_TAB_t) { &gyroConfig_gyro_to_use, 2, osdTableGyroToUse}, 0 }, + { "GYRO TO USE", OME_TAB, NULL, &(OSD_TAB_t) { &gyroConfig_gyro_to_use, 2, osdTableGyroToUse}, REBOOT_REQUIRED }, #endif { "BACK", OME_Back, NULL, NULL, 0 },