Suunto EON Steel: add desaturation time reporting

The EON Steel reports it in seconds remaining after the dive.  That's a
bit excessive, but I guess SI units is where it's at.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2016-07-21 09:17:34 +09:00 committed by Dirk Hohndel
parent 5d4e1f97db
commit 69d26e00b0

View File

@ -1344,6 +1344,16 @@ static int traverse_diving_fields(suunto_eonsteel_parser_t *eon, const struct ty
return 0;
}
if (!strcmp(name, "DesaturationTime")) {
char desat[16];
unsigned int time = array_uint32_le(data); // In seconds!
// Let's just agree to ignore seconds
time /= 60;
snprintf(desat, sizeof(desat), "%d:%02d", time / 60, time % 60);
return add_string(eon, "Desaturation Time", desat);
}
return 0;
}