Skip to content

Commit

Permalink
ArduPlane: allow HarmonicNotches to be compiled out of the code
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Mar 16, 2024
1 parent d9c946a commit 2c7c3f1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ArduPlane/ArduPlane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,11 @@ void Plane::update_logging25(void)

if (should_log(MASK_LOG_CTUN)) {
Log_Write_Control_Tuning();
#if AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED
if (!should_log(MASK_LOG_NOTCH_FULLRATE)) {
AP::ins().write_notch_log_messages();
}
#endif
#if HAL_GYROFFT_ENABLED
gyro_fft.write_log_messages();
#endif
Expand Down
2 changes: 2 additions & 0 deletions ArduPlane/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ void Plane::Log_Write_FullRate(void)
if (should_log(MASK_LOG_ATTITUDE_FULLRATE)) {
Log_Write_Attitude();
}
#if AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED
if (should_log(MASK_LOG_NOTCH_FULLRATE)) {
AP::ins().write_notch_log_messages();
}
#endif
}


Expand Down
4 changes: 3 additions & 1 deletion ArduPlane/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,7 @@ void Plane::load_parameters(void)
}
#endif

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

#endif // AP_INERTIALSENSOR_HARMONICNOTCH_ENABLED

// PARAMETER_CONVERSION - Added: Mar-2022
#if AP_FENCE_ENABLED
AP_Param::convert_class(g.k_param_fence, &fence, fence.var_info, 0, true);
Expand Down

0 comments on commit 2c7c3f1

Please sign in to comment.