X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=uemis.c;h=28302b1c0c75ae955d9ae29baf91fcf74056d676;hb=eac816b9d8a199375cf023a956c0959ccf3bc87b;hp=5450bf38dc16e9ee462cd2bdc188866ae72d4ff4;hpb=d7e35c512c4a4d6691c7c1312691c17cce4c684e;p=ext%2Fsubsurface.git diff --git a/uemis.c b/uemis.c index 5450bf3..28302b1 100644 --- a/uemis.c +++ b/uemis.c @@ -14,7 +14,6 @@ #include #define __USE_XOPEN #include -#include #include "dive.h" #include "uemis.h" @@ -87,9 +86,9 @@ static int pressure_to_depth(uint16_t value) { double atm, cm; - atm = (value / 100.0) / 1.01325; + atm = bar_to_atm(value / 100.0); cm = 100 * atm + 0.5; - return( (cm > 0) ? 10 * (long)cm : 0); + return (cm > 0) ? 10 * (long)cm : 0; } /* @@ -198,6 +197,8 @@ void uemis_parse_divelog_binary(char *base64, void *datap) { gasoffset = template = *(uint8_t *)(data+115); if (template == 3) gasoffset = 4; + if (template == 0) + template = 1; for (i = 0; i < template; i++) { float volume = *(float *)(data+116+25*(gasoffset + i)) * 1000.0; /* uemis always assumes a working pressure of 202.6bar (!?!?) - I first thought