diff options
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -134,9 +134,10 @@ static inline int interpolate(int a, int b, int part, int whole) return rint(x / whole); } -static inline depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit) { +/* MOD rounded to multiples of roundto mm */ +static inline depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit, int roundto) { depth_t depth; - depth.mm = po2_limit.mbar * 1000 / get_o2(mix) * 10 - 10000; + depth.mm = ((po2_limit.mbar * 1000 / get_o2(mix) * 10 - 10000) / roundto) * roundto; return depth; } |