On Wed, May 24, 2017 at 10:13 AM, janmulder notifications@github.com wrote:
In addition some merge conflicts are resolved.
So since I want to know what's going on, I ended up doing my own merging and re-resolving things, and while I did that I became convinced that there is a bug in the PPO2 reporting for the predator.
The code does this:
#ifdef SENSOR_AVERAGE sample.ppo2 = data[offset + 6] / 100.0; if (callback) callback (DC_SAMPLE_PPO2, sample, userdata); #else if ((status & PPO2_EXTERNAL) == 0) { sample.ppo2 = data[offset + 12] * parser->calibration[0]; if (callback && (data[86] & 0x01)) callback (DC_SAMPLE_PPO2, sample, userdata);
sample.ppo2 = data[offset + 14] * parser->calibration[1]; if (callback && (data[86] & 0x02)) callback (DC_SAMPLE_PPO2, sample, userdata);
sample.ppo2 = data[offset + 15] * parser->calibration[2]; if (callback && (data[86] & 0x04)) callback (DC_SAMPLE_PPO2, sample, userdata); } #endif
which means that if you don't have SENSOR_AVERAGE defined, and if it's an external sensor, now there's no sensor reporting AT ALL.
Which seems bogus.
So either that average PPO2 should be sent if there's an external sensor, or that SENSOR_AVERAGE case should also be inside that "check for external sensor". The code as it stands now makes no sense.
Anton, I think this is all yours. Comments?
Linus
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ libdivecomputer-devel mailing list libdivecomputer-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdivecomputer-devel
On Thu, May 25, 2017 at 10:21 AM, Linus Torvalds torvalds@linux-foundation.org wrote:
So since I want to know what's going on, I ended up doing my own merging and re-resolving things, and while I did that I became convinced that there is a bug in the PPO2 reporting for the predator.
Side note: I pushed out the merge anyway, because the bug is not in the merge, it's in the original code. But let's aim to fix it.
Jan, can you check my merge against yours? I noticed an older (harmless) merge error wrt the Shearwater sample size parser state initialization, so our merges may not be identical, but as usual I don't actually have any of the devices that the code changes touch, so it would be good to check.
(Actually, I guess I have Dirk's Shearwater for my failed BT testing, I could try to see if I can get at least the old one working)
Linus
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ libdivecomputer-devel mailing list libdivecomputer-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdivecomputer-devel