mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
ina226/voxlpm: make sure parameter sub is reset
The subscription to parameter updates has to get copied otherwise the change detection will not get reset for next time.
This commit is contained in:
parent
165c8b23bf
commit
f92c5aa688
@ -210,9 +210,11 @@ INA226::collect()
|
||||
{
|
||||
perf_begin(_sample_perf);
|
||||
|
||||
parameter_update_s param_update;
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// Read from topic to clear updated flag
|
||||
parameter_update_s parameter_update;
|
||||
_parameter_update_sub.copy(¶meter_update);
|
||||
|
||||
if (_parameters_sub.copy(¶m_update)) {
|
||||
updateParams();
|
||||
}
|
||||
|
||||
|
||||
@ -169,7 +169,7 @@ private:
|
||||
|
||||
Battery _battery;
|
||||
uORB::Subscription _actuators_sub{ORB_ID(actuator_controls_0)};
|
||||
uORB::Subscription _parameters_sub{ORB_ID(parameter_update)};
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
|
||||
|
||||
int read(uint8_t address, int16_t &data);
|
||||
int write(uint8_t address, uint16_t data);
|
||||
|
||||
@ -316,9 +316,11 @@ VOXLPM::measure()
|
||||
}
|
||||
}
|
||||
|
||||
parameter_update_s update;
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// Read from topic to clear updated flag
|
||||
parameter_update_s parameter_update;
|
||||
_parameter_update_sub.copy(¶meter_update);
|
||||
|
||||
if (_parameter_sub.update(&update)) {
|
||||
updateParams();
|
||||
}
|
||||
|
||||
|
||||
@ -253,7 +253,7 @@ private:
|
||||
perf_counter_t _comms_errors;
|
||||
|
||||
uORB::PublicationMulti<power_monitor_s> _pm_pub_topic{ORB_ID(power_monitor)};
|
||||
uORB::Subscription _parameter_sub{ORB_ID(parameter_update)};
|
||||
uORB::Subscription _parameter_update_sub{ORB_ID(parameter_update)};
|
||||
|
||||
power_monitor_s _pm_status{};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user