From 9d77c05d1f18b65169743787259a4211a103318b Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Tue, 24 Jul 2018 15:51:01 +0200 Subject: [PATCH] Add DTerm LPF2 to the CMS menu --- src/main/cms/cms_menu_imu.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/cms/cms_menu_imu.c b/src/main/cms/cms_menu_imu.c index b38553b18..f291932dd 100644 --- a/src/main/cms/cms_menu_imu.c +++ b/src/main/cms/cms_menu_imu.c @@ -370,6 +370,7 @@ static CMS_Menu cmsx_menuFilterGlobal = { }; static uint16_t cmsx_dterm_lowpass_hz; +static uint16_t cmsx_dterm_lowpass2_hz; static uint16_t cmsx_dterm_notch_hz; static uint16_t cmsx_dterm_notch_cutoff; static uint16_t cmsx_yaw_lowpass_hz; @@ -377,10 +378,12 @@ static uint16_t cmsx_yaw_lowpass_hz; static long cmsx_FilterPerProfileRead(void) { const pidProfile_t *pidProfile = pidProfiles(pidProfileIndex); - cmsx_dterm_lowpass_hz = pidProfile->dterm_lowpass_hz; - cmsx_dterm_notch_hz = pidProfile->dterm_notch_hz; + + cmsx_dterm_lowpass_hz = pidProfile->dterm_lowpass_hz; + cmsx_dterm_lowpass2_hz = pidProfile->dterm_lowpass2_hz; + cmsx_dterm_notch_hz = pidProfile->dterm_notch_hz; cmsx_dterm_notch_cutoff = pidProfile->dterm_notch_cutoff; - cmsx_yaw_lowpass_hz = pidProfile->yaw_lowpass_hz; + cmsx_yaw_lowpass_hz = pidProfile->yaw_lowpass_hz; return 0; } @@ -390,10 +393,12 @@ static long cmsx_FilterPerProfileWriteback(const OSD_Entry *self) UNUSED(self); pidProfile_t *pidProfile = currentPidProfile; - pidProfile->dterm_lowpass_hz = cmsx_dterm_lowpass_hz; - pidProfile->dterm_notch_hz = cmsx_dterm_notch_hz; + + pidProfile->dterm_lowpass_hz = cmsx_dterm_lowpass_hz; + pidProfile->dterm_lowpass2_hz = cmsx_dterm_lowpass2_hz; + pidProfile->dterm_notch_hz = cmsx_dterm_notch_hz; pidProfile->dterm_notch_cutoff = cmsx_dterm_notch_cutoff; - pidProfile->yaw_lowpass_hz = cmsx_yaw_lowpass_hz; + pidProfile->yaw_lowpass_hz = cmsx_yaw_lowpass_hz; return 0; } @@ -403,6 +408,7 @@ static OSD_Entry cmsx_menuFilterPerProfileEntries[] = { "-- FILTER PP --", OME_Label, NULL, NULL, 0 }, { "DTERM LPF", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_lowpass_hz, 0, 500, 1 }, 0 }, + { "DTERM LPF2", OME_UINT16, NULL, &(OSD_UINT16_t){ &cmsx_dterm_lowpass2_hz, 0, 500, 1 }, 0 }, { "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 }, -- 2.11.4.GIT