Skip to content

Commit

Permalink
add Gyro LPF2 type to OSD (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdCopter authored Oct 26, 2023
1 parent 6ba5446 commit de71a3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/cms/cms_menu_imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ static uint8_t gyroConfig_gyro_lowpass1_type;
static uint16_t gyroConfig_gyro_lowpass_hz_roll;
static uint16_t gyroConfig_gyro_lowpass_hz_pitch;
static uint16_t gyroConfig_gyro_lowpass_hz_yaw;
static uint8_t gyroConfig_gyro_lowpass2_type;
static uint16_t gyroConfig_gyro_lowpass2_hz_roll;
static uint16_t gyroConfig_gyro_lowpass2_hz_pitch;
static uint16_t gyroConfig_gyro_lowpass2_hz_yaw;
Expand Down Expand Up @@ -524,6 +525,7 @@ static long cmsx_menuGyro_onEnter(void) {
gyroConfig_gyro_lowpass_hz_roll = gyroConfig()->gyro_lowpass_hz[ROLL];
gyroConfig_gyro_lowpass_hz_pitch = gyroConfig()->gyro_lowpass_hz[PITCH];
gyroConfig_gyro_lowpass_hz_yaw = gyroConfig()->gyro_lowpass_hz[YAW];
gyroConfig_gyro_lowpass2_type = gyroConfig()->gyro_lowpass2_type;
gyroConfig_gyro_lowpass2_hz_roll = gyroConfig()->gyro_lowpass2_hz[ROLL];
gyroConfig_gyro_lowpass2_hz_pitch = gyroConfig()->gyro_lowpass2_hz[PITCH];
gyroConfig_gyro_lowpass2_hz_yaw = gyroConfig()->gyro_lowpass2_hz[YAW];
Expand Down Expand Up @@ -558,6 +560,7 @@ static long cmsx_menuGyro_onExit(const OSD_Entry *self) {
gyroConfigMutable()->gyro_lowpass_hz[ROLL] = gyroConfig_gyro_lowpass_hz_roll;
gyroConfigMutable()->gyro_lowpass_hz[PITCH] = gyroConfig_gyro_lowpass_hz_pitch;
gyroConfigMutable()->gyro_lowpass_hz[YAW] = gyroConfig_gyro_lowpass_hz_yaw;
gyroConfigMutable()->gyro_lowpass2_type = gyroConfig_gyro_lowpass2_type;
gyroConfigMutable()->gyro_lowpass2_hz[ROLL] = gyroConfig_gyro_lowpass2_hz_roll;
gyroConfigMutable()->gyro_lowpass2_hz[PITCH] = gyroConfig_gyro_lowpass2_hz_pitch;
gyroConfigMutable()->gyro_lowpass2_hz[YAW] = gyroConfig_gyro_lowpass2_hz_yaw;
Expand Down Expand Up @@ -589,11 +592,12 @@ static long cmsx_menuGyro_onExit(const OSD_Entry *self) {
static OSD_Entry cmsx_menuFilterGlobalEntries[] = {
{ "-- FILTER GLB --", OME_Label, NULL, NULL, 0 },

{ "GYRO LPF TYPE", OME_TAB, NULL, &(OSD_TAB_t) { (uint8_t *) &gyroConfig_gyro_lowpass1_type, 4, cms_FilterType }, 0 },
{ "GYRO LPF ROLL", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass_hz_roll, 0, 16000, 1 }, 0 },
{ "GYRO LPF PITCH", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass_hz_pitch, 0, 16000, 1 }, 0 },
{ "GYRO LPF YAW", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass_hz_yaw, 0, 16000, 1 }, 0 },
{ "GYRO LPF TYPE", OME_TAB, NULL, &(OSD_TAB_t) { (uint8_t *) &gyroConfig_gyro_lowpass1_type, 4, cms_FilterType }, 0 },
#ifdef USE_GYRO_LPF2
{ "GYRO LPF2 TYPE", OME_TAB, NULL, &(OSD_TAB_t) { (uint8_t *) &gyroConfig_gyro_lowpass2_type, 4, cms_FilterType }, 0 },
{ "GYRO LPF2 ROLL", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass2_hz_roll, 0, 16000, 1 }, 0 },
{ "GYRO LPF2 PITCH", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass2_hz_pitch, 0, 16000, 1 }, 0 },
{ "GYRO LPF2 YAW", OME_UINT16, NULL, &(OSD_UINT16_t) { &gyroConfig_gyro_lowpass2_hz_yaw, 0, 16000, 1 }, 0 },
Expand Down

0 comments on commit de71a3a

Please sign in to comment.