parameter_update use uORB::Subscription consistently

This commit is contained in:
Daniel Agar
2019-09-29 10:49:03 -04:00
parent bbb96cbd0c
commit c8e59c4e39
47 changed files with 274 additions and 259 deletions
+9 -11
View File
@@ -2569,9 +2569,15 @@ MavlinkReceiver::Run()
hrt_abstime last_send_update = 0;
while (!_mavlink->_task_should_exit) {
// Check for updated parameters.
if (_param_update_sub.updated()) {
update_params();
// check for parameter updates
if (_parameter_update_sub.updated()) {
// clear update
parameter_update_s pupdate;
_parameter_update_sub.copy(&pupdate);
// update parameters from storage
updateParams();
}
if (poll(&fds[0], 1, timeout) > 0) {
@@ -2718,11 +2724,3 @@ MavlinkReceiver::receive_start(pthread_t *thread, Mavlink *parent)
pthread_attr_destroy(&receiveloop_attr);
}
void
MavlinkReceiver::update_params()
{
parameter_update_s param_update;
_param_update_sub.update(&param_update);
updateParams();
}