ArduPlane: allow HarmonicNotches to be compiled out of the code

This commit is contained in:
Peter Barker 2024-02-13 11:26:08 +11:00 committed by Andrew Tridgell
parent 4569b1ba14
commit 626d64f503
3 changed files with 7 additions and 1 deletions

View File

@ -273,9 +273,11 @@ void Plane::update_logging25(void)
if (should_log(MASK_LOG_CTUN)) { if (should_log(MASK_LOG_CTUN)) {
Log_Write_Control_Tuning(); Log_Write_Control_Tuning();
#if AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED
if (!should_log(MASK_LOG_NOTCH_FULLRATE)) { if (!should_log(MASK_LOG_NOTCH_FULLRATE)) {
AP::ins().write_notch_log_messages(); AP::ins().write_notch_log_messages();
} }
#endif
#if HAL_GYROFFT_ENABLED #if HAL_GYROFFT_ENABLED
gyro_fft.write_log_messages(); gyro_fft.write_log_messages();
#endif #endif

View File

@ -65,9 +65,11 @@ void Plane::Log_Write_FullRate(void)
if (should_log(MASK_LOG_ATTITUDE_FULLRATE)) { if (should_log(MASK_LOG_ATTITUDE_FULLRATE)) {
Log_Write_Attitude(); Log_Write_Attitude();
} }
#if AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED
if (should_log(MASK_LOG_NOTCH_FULLRATE)) { if (should_log(MASK_LOG_NOTCH_FULLRATE)) {
AP::ins().write_notch_log_messages(); AP::ins().write_notch_log_messages();
} }
#endif
} }

View File

@ -1481,6 +1481,7 @@ void Plane::load_parameters(void)
} }
#endif #endif
#if AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED
#if HAL_INS_NUM_HARMONIC_NOTCH_FILTERS > 1 #if HAL_INS_NUM_HARMONIC_NOTCH_FILTERS > 1
if (!ins.harmonic_notches[1].params.enabled()) { if (!ins.harmonic_notches[1].params.enabled()) {
// notch filter parameter conversions (moved to INS_HNTC2) for 4.2.x, converted from fixed notch // notch filter parameter conversions (moved to INS_HNTC2) for 4.2.x, converted from fixed notch
@ -1495,6 +1496,7 @@ void Plane::load_parameters(void)
AP_Param::set_default_by_name("INS_HNTC2_HMNCS", 1); AP_Param::set_default_by_name("INS_HNTC2_HMNCS", 1);
} }
#endif // HAL_INS_NUM_HARMONIC_NOTCH_FILTERS #endif // HAL_INS_NUM_HARMONIC_NOTCH_FILTERS
#endif // AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED
// PARAMETER_CONVERSION - Added: Mar-2022 // PARAMETER_CONVERSION - Added: Mar-2022
#if AP_FENCE_ENABLED #if AP_FENCE_ENABLED