drv/counter/ev3dev_stretch_iio: flush after read
Without it, the values do not update.
@@ -48,6 +48,10 @@ static pbio_error_t pbdrv_counter_ev3dev_stretch_iio_get_count(pbdrv_counter_dev
return PBIO_ERROR_IO;
}
+ if (fflush(data->count) != 0) {
+ return PBIO_ERROR_IO;
+ }
+
return PBIO_SUCCESS;
}
@@ -66,6 +70,10 @@ static pbio_error_t pbdrv_counter_ev3dev_stretch_iio_get_rate(pbdrv_counter_dev_
return PBIO_ERROR_IO;
}
+ if (fflush(data->rate) != 0) {
+ return PBIO_ERROR_IO;
+ }
+
return PBIO_SUCCESS;
}
