mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 04:13:33 +08:00
parameter_update use uORB::Subscription consistently
This commit is contained in:
@@ -454,15 +454,16 @@ void FixedwingAttitudeControl::Run()
|
||||
|
||||
if (_att_sub.update(&_att)) {
|
||||
|
||||
/* only update parameters if they changed */
|
||||
bool params_updated = _params_sub.updated();
|
||||
// only update parameters if they changed
|
||||
bool params_updated = _parameter_update_sub.updated();
|
||||
|
||||
// check for parameter updates
|
||||
if (params_updated) {
|
||||
/* read from param to clear updated flag */
|
||||
parameter_update_s update;
|
||||
_params_sub.copy(&update);
|
||||
// clear update
|
||||
parameter_update_s pupdate;
|
||||
_parameter_update_sub.copy(&pupdate);
|
||||
|
||||
/* update parameters from storage */
|
||||
// update parameters from storage
|
||||
parameters_update();
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
uORB::Subscription _battery_status_sub{ORB_ID(battery_status)}; /**< battery status subscription */
|
||||
uORB::Subscription _global_pos_sub{ORB_ID(vehicle_global_position)}; /**< global position subscription */
|
||||
uORB::Subscription _manual_sub{ORB_ID(manual_control_setpoint)}; /**< notification of manual control updates */
|
||||
uORB::Subscription _params_sub{ORB_ID(parameter_update)}; /**< notification of parameter updates */
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)}; /**< notification of parameter updates */
|
||||
uORB::Subscription _rates_sp_sub{ORB_ID(vehicle_rates_setpoint)}; /**< vehicle rates setpoint */
|
||||
uORB::Subscription _vcontrol_mode_sub{ORB_ID(vehicle_control_mode)}; /**< vehicle status subscription */
|
||||
uORB::Subscription _vehicle_land_detected_sub{ORB_ID(vehicle_land_detected)}; /**< vehicle land detected subscription */
|
||||
|
||||
Reference in New Issue
Block a user