]> git.tdb.fi Git - ext/subsurface.git/blobdiff - uemis.c
Fix profile and average depth for freedives
[ext/subsurface.git] / uemis.c
diff --git a/uemis.c b/uemis.c
index f55407b4bc254ab0ee9a641b2b6075d996ce983e..06ef5b4231c6f85e6474d182b04a5cf7911d8f2b 100644 (file)
--- a/uemis.c
+++ b/uemis.c
@@ -86,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;
 }
 
 /*
@@ -231,7 +231,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
                sample->cylinderindex = u_sample->active_tank;
                sample->cylinderpressure.mbar= u_sample->tank_pressure * 10;
                uemis_event(dive, sample, u_sample);
-               finish_sample(dive, sample);
+               finish_sample(dive);
                i += 0x25;
                u_sample++;
        }