Skip to content

Commit cfe345a

Browse files
committed
Exclude O2 sensors without calibration data
O2 sensor for which no calibration data is available will always result in a ppO2 value of zero for all samples, which isn't very useful.
1 parent d47e1ce commit cfe345a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/divesoft_freedom_parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,8 +1017,8 @@ divesoft_freedom_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba
10171017
for (unsigned int i = 0; i < NSENSORS; ++i) {
10181018
unsigned int value = array_uint16_le (data + offset + 4 + i * 2);
10191019
unsigned int state = data[offset + 12 + i];
1020-
if (!parser->calibrated || state == SENSTAT_UNCALIBRATED ||
1021-
state == SENSTAT_NOT_EXIST)
1020+
if (!parser->calibrated || parser->calibration[i] == 0 ||
1021+
state == SENSTAT_UNCALIBRATED || state == SENSTAT_NOT_EXIST)
10221022
continue;
10231023
sample.ppo2.sensor = i;
10241024
sample.ppo2.value = value / 100.0 * parser->calibration[i] / BAR;

0 commit comments

Comments
 (0)