mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 13:43:33 +08:00
parameter_update use uORB::Subscription consistently
This commit is contained in:
@@ -123,7 +123,7 @@ private:
|
||||
uORB::Subscription _vehicle_status_sub{ORB_ID(vehicle_status)}; /**< vehicle status subscription */
|
||||
uORB::Subscription _vehicle_land_detected_sub{ORB_ID(vehicle_land_detected)}; /**< vehicle land detected subscription */
|
||||
uORB::Subscription _control_mode_sub{ORB_ID(vehicle_control_mode)}; /**< vehicle control mode subscription */
|
||||
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 _att_sub{ORB_ID(vehicle_attitude)}; /**< vehicle attitude */
|
||||
uORB::Subscription _home_pos_sub{ORB_ID(home_position)}; /**< home position */
|
||||
|
||||
@@ -312,10 +312,13 @@ MulticopterPositionControl::warn_rate_limited(const char *string)
|
||||
int
|
||||
MulticopterPositionControl::parameters_update(bool force)
|
||||
{
|
||||
parameter_update_s param_upd;
|
||||
bool updated = _params_sub.update(¶m_upd);
|
||||
// check for parameter updates
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// clear update
|
||||
parameter_update_s pupdate;
|
||||
_parameter_update_sub.copy(&pupdate);
|
||||
|
||||
if (updated || force) {
|
||||
// update parameters from storage
|
||||
ModuleParams::updateParams();
|
||||
SuperBlock::updateParams();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user