mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-20 15:47:34 +08:00
replace unnecessary perf_alloc_once usage
This commit is contained in:
@@ -181,7 +181,7 @@ AirspeedModule::AirspeedModule():
|
||||
// initialise parameters
|
||||
update_params();
|
||||
|
||||
_perf_elapsed = perf_alloc_once(PC_ELAPSED, "airspeed_selector elapsed");
|
||||
_perf_elapsed = perf_alloc(PC_ELAPSED, MODULE_NAME": elapsed");
|
||||
}
|
||||
|
||||
AirspeedModule::~AirspeedModule()
|
||||
@@ -189,7 +189,6 @@ AirspeedModule::~AirspeedModule()
|
||||
ScheduleClear();
|
||||
|
||||
perf_free(_perf_elapsed);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -534,7 +534,7 @@ Ekf2::Ekf2(bool replay_mode):
|
||||
ModuleParams(nullptr),
|
||||
WorkItem(MODULE_NAME, px4::wq_configurations::att_pos_ctrl),
|
||||
_replay_mode(replay_mode),
|
||||
_ekf_update_perf(perf_alloc_once(PC_ELAPSED, MODULE_NAME": update")),
|
||||
_ekf_update_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": update")),
|
||||
_params(_ekf.getParamHandle()),
|
||||
_param_ekf2_min_obs_dt(_params->sensor_interval_min_ms),
|
||||
_param_ekf2_mag_delay(_params->mag_delay_ms),
|
||||
|
||||
@@ -281,7 +281,7 @@ MulticopterPositionControl::MulticopterPositionControl(bool vtol) :
|
||||
_vel_x_deriv(this, "VELD"),
|
||||
_vel_y_deriv(this, "VELD"),
|
||||
_vel_z_deriv(this, "VELD"),
|
||||
_cycle_perf(perf_alloc_once(PC_ELAPSED, MODULE_NAME": cycle time"))
|
||||
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle time"))
|
||||
{
|
||||
if (vtol) {
|
||||
// if vehicle is a VTOL we want to enable weathervane capabilities
|
||||
|
||||
@@ -215,9 +215,9 @@ private:
|
||||
|
||||
simulator::Report<simulator::RawGPSData> _gps{1};
|
||||
|
||||
perf_counter_t _perf_gps{perf_alloc_once(PC_ELAPSED, "sim_gps_delay")};
|
||||
perf_counter_t _perf_sim_delay{perf_alloc_once(PC_ELAPSED, "sim_network_delay")};
|
||||
perf_counter_t _perf_sim_interval{perf_alloc(PC_INTERVAL, "sim_network_interval")};
|
||||
perf_counter_t _perf_gps{perf_alloc(PC_ELAPSED, MODULE_NAME": gps delay")};
|
||||
perf_counter_t _perf_sim_delay{perf_alloc(PC_ELAPSED, MODULE_NAME": network delay")};
|
||||
perf_counter_t _perf_sim_interval{perf_alloc(PC_INTERVAL, MODULE_NAME": network interval")};
|
||||
|
||||
// uORB publisher handlers
|
||||
uORB::Publication<battery_status_s> _battery_pub{ORB_ID(battery_status)};
|
||||
|
||||
Reference in New Issue
Block a user