Merge pull request #6445 from McGiverGim/add_dterm2_cms

Add DTerm LPF2 to the CMS menu
This commit is contained in:
Michael Keller 2018-07-25 13:18:44 +12:00 committed by GitHub
commit f2907e5746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -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 },