Limit the tank pressure workaround to hwOS devices

The workaround for the tank pressure in the previous commit is only
relevant for the newer hwOS based devices, and not for the original OSTC
devices. In practice this doesn't cause any problems because the
original OSTC doesn't support a tank pressure sensor, but nevertheless
it's better to use the correct condition.
This commit is contained in:
Jef Driesen 2019-11-19 20:47:53 +01:00
parent ab230fd4e0
commit 7f21998ad5

View File

@ -921,7 +921,8 @@ hw_ostc_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t call
sample.pressure.value = value;
// The hwOS Sport firmware used a resolution of
// 0.1 bar between versions 10.40 and 10.50.
if (parser->model != OSTC4 && (firmware >= 0x0A28 && firmware <= 0x0A32)) {
if (parser->hwos && parser->model != OSTC4 &&
(firmware >= 0x0A28 && firmware <= 0x0A32)) {
sample.pressure.value /= 10.0;
}
if (callback) callback (DC_SAMPLE_PRESSURE, sample, userdata);