mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-03 18:20:34 +08:00
parameter_update use uORB::Subscription consistently
This commit is contained in:
@@ -1662,15 +1662,13 @@ FixedwingPositionControl::Run()
|
||||
/* only run controller if position changed */
|
||||
if (_global_pos_sub.update(&_global_pos)) {
|
||||
|
||||
/* only update parameters if they changed */
|
||||
bool params_updated = _params_sub.updated();
|
||||
// check for parameter updates
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// clear update
|
||||
parameter_update_s pupdate;
|
||||
_parameter_update_sub.copy(&pupdate);
|
||||
|
||||
if (params_updated) {
|
||||
/* read from param to clear updated flag */
|
||||
parameter_update_s update;
|
||||
_params_sub.copy(&update);
|
||||
|
||||
/* update parameters from storage */
|
||||
// update parameters from storage
|
||||
parameters_update();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user