don't use DSHOT_TEL_CFG directly in code since it is autogenerated only if a board has serial config

This commit is contained in:
Jacob Dahl
2026-01-15 13:51:22 -09:00
parent 6bc0e0c74e
commit 7edc606296
2 changed files with 4 additions and 8 deletions
+3 -6
View File
@@ -71,7 +71,6 @@ int DShot::init()
{
update_params();
_serial_telemetry_enabled = _param_dshot_tel_cfg.get();
_bdshot_edt_enabled = _param_dshot_bidir_edt.get();
if (initialize_dshot()) {
@@ -1001,16 +1000,14 @@ void DShot::init_telemetry(const char *device, bool swap_rxtx)
return;
}
if (!_serial_telemetry_enabled) {
PX4_ERR("serial telemetry not enabled");
return;
}
if (_telemetry.init(device, swap_rxtx) != PX4_OK) {
PX4_ERR("telemetry init failed");
return;
}
// Enable serial telemetry now that we've successfully initialized
_serial_telemetry_enabled = true;
// Initialize ESC settings handlers based on ESC type
ESCType esc_type = static_cast<ESCType>(_param_dshot_esc_type.get());
_telemetry.initSettingsHandlers(esc_type, _output_mask);
+1 -2
View File
@@ -231,7 +231,6 @@ private:
(ParamInt<px4::params::DSHOT_3D_DEAD_H>) _param_dshot_3d_dead_h,
(ParamInt<px4::params::DSHOT_3D_DEAD_L>) _param_dshot_3d_dead_l,
(ParamInt<px4::params::MOT_POLE_COUNT>) _param_mot_pole_count,
(ParamBool<px4::params::DSHOT_BIDIR_EDT>) _param_dshot_bidir_edt,
(ParamBool<px4::params::DSHOT_TEL_CFG>) _param_dshot_tel_cfg
(ParamBool<px4::params::DSHOT_BIDIR_EDT>) _param_dshot_bidir_edt
)
};