mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-04 06:31:37 +08:00
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:
@@ -71,7 +71,6 @@ int DShot::init()
|
|||||||
{
|
{
|
||||||
update_params();
|
update_params();
|
||||||
|
|
||||||
_serial_telemetry_enabled = _param_dshot_tel_cfg.get();
|
|
||||||
_bdshot_edt_enabled = _param_dshot_bidir_edt.get();
|
_bdshot_edt_enabled = _param_dshot_bidir_edt.get();
|
||||||
|
|
||||||
if (initialize_dshot()) {
|
if (initialize_dshot()) {
|
||||||
@@ -1001,16 +1000,14 @@ void DShot::init_telemetry(const char *device, bool swap_rxtx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_serial_telemetry_enabled) {
|
|
||||||
PX4_ERR("serial telemetry not enabled");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_telemetry.init(device, swap_rxtx) != PX4_OK) {
|
if (_telemetry.init(device, swap_rxtx) != PX4_OK) {
|
||||||
PX4_ERR("telemetry init failed");
|
PX4_ERR("telemetry init failed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable serial telemetry now that we've successfully initialized
|
||||||
|
_serial_telemetry_enabled = true;
|
||||||
|
|
||||||
// Initialize ESC settings handlers based on ESC type
|
// Initialize ESC settings handlers based on ESC type
|
||||||
ESCType esc_type = static_cast<ESCType>(_param_dshot_esc_type.get());
|
ESCType esc_type = static_cast<ESCType>(_param_dshot_esc_type.get());
|
||||||
_telemetry.initSettingsHandlers(esc_type, _output_mask);
|
_telemetry.initSettingsHandlers(esc_type, _output_mask);
|
||||||
|
|||||||
@@ -231,7 +231,6 @@ private:
|
|||||||
(ParamInt<px4::params::DSHOT_3D_DEAD_H>) _param_dshot_3d_dead_h,
|
(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::DSHOT_3D_DEAD_L>) _param_dshot_3d_dead_l,
|
||||||
(ParamInt<px4::params::MOT_POLE_COUNT>) _param_mot_pole_count,
|
(ParamInt<px4::params::MOT_POLE_COUNT>) _param_mot_pole_count,
|
||||||
(ParamBool<px4::params::DSHOT_BIDIR_EDT>) _param_dshot_bidir_edt,
|
(ParamBool<px4::params::DSHOT_BIDIR_EDT>) _param_dshot_bidir_edt
|
||||||
(ParamBool<px4::params::DSHOT_TEL_CFG>) _param_dshot_tel_cfg
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user