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:
Matthias Grob
2020-09-01 10:25:03 +02:00
parent 9c4e26c00c
commit d82f325f8d
4 changed files with 10 additions and 6 deletions
+4 -2
View File
@@ -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(&parameter_update);
if (_parameters_sub.copy(&param_update)) {
updateParams();
}