From 854f58fa32011cd32adba64d8f132cd0ae7a3044 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 14 Oct 2015 20:10:29 +0200 Subject: [PATCH] Cleanup and correct CCR detection == has precedence over & and would have needed some parenthesis. Instead of that, this moves that code into the block below which already contains a correct CCR check. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- src/shearwater_predator_parser.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c index cc9edf6..f1b8747 100644 --- a/src/shearwater_predator_parser.c +++ b/src/shearwater_predator_parser.c @@ -453,13 +453,11 @@ shearwater_predator_parser_samples_foreach (dc_parser_t *abstract, dc_sample_cal // Status flags. unsigned int status = data[offset + 11]; - // PPO2 -- only return PPO2 if we are in closed circuit mode - if (data[offset + 11] & 0x10 == 0) { + if ((status & OC) == 0) { + // PPO2 -- only return PPO2 if we are in closed circuit mode sample.ppo2 = data[offset + 6] / 100.0; if (callback) callback (DC_SAMPLE_PPO2, sample, userdata); - } - if ((status & OC) == 0) { // Setpoint if (parser->petrel) { sample.setpoint = data[offset + 18] / 100.0;