parameter_update use uORB::Subscription consistently

This commit is contained in:
Daniel Agar
2019-07-28 11:55:52 -04:00
parent bbb96cbd0c
commit c8e59c4e39
47 changed files with 274 additions and 259 deletions
@@ -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();
}