diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-11-09 13:15:19 +0100 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-09 14:43:57 +0100 |
commit | 97712559192ca82d10eba91fede6d432c404aadc (patch) | |
tree | 7392ceeb20a2b0d7d5e5dc8e915a6ef6b894ce67 /core/dive.h | |
parent | a013e35ff4156137c07ebf4b8574d15a3023c4cd (diff) | |
download | subsurface-97712559192ca82d10eba91fede6d432c404aadc.tar.gz |
CNS can be higher than 255%
I'm sure this bug has heen here forever, but the CNS clock is
not very relevant for most divers, and even some technical divers
do not care about this value.
However, doing long decompression dives, the value can easily
grow over 100%, and a lot further. For example, the OSTC computers
use 2 bytes to store the CNS value in the profile data, and I
have multiple dives in my logbook going way over 255%.
This all said. Just store the CNS value in an unsigned 16 bit.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/dive.h b/core/dive.h index ad0ad66bb..0563e0d4e 100644 --- a/core/dive.h +++ b/core/dive.h @@ -214,7 +214,7 @@ struct sample // BASE TYPE BYTES UNITS RANGE DE o2pressure_t o2sensor[3]; // uint16_t 6 mbar (0-65 bar) Up to 3 PO2 sensor values (rebreather) bearing_t bearing; // int16_t 2 degrees (-32k to 32k deg) compass bearing uint8_t sensor[MAX_SENSORS]; // uint8_t 1 sensorID (0-255) ID of cylinder pressure sensor - uint8_t cns; // uint8_t 1 % (0-255 %) cns% accumulated + uint16_t cns; // uint16_t 1 % (0-64k %) cns% accumulated uint8_t heartbeat; // uint8_t 1 beats/m (0-255) heart rate measurement volume_t sac; // 4 ml/min predefined SAC bool in_deco; // bool 1 y/n y/n this sample is part of deco |