diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-04-24 13:58:39 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-25 07:19:18 -0700 |
commit | 0be8512ab07625064f9c7a6243acfe765b28abcf (patch) | |
tree | b6aa4d622e8dc7ff5191d114c558712a95e0f84f /dive.c | |
parent | 0785a7f0cac3d1cf5b84e7f62407466c6798df34 (diff) | |
download | subsurface-0be8512ab07625064f9c7a6243acfe765b28abcf.tar.gz |
Add small helper to determine if dive computer has HR data
Currently unused, but requested for a future feature.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r-- | dive.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -199,6 +199,21 @@ double get_weight_units(unsigned int grams, int *frac, const char **units) return value; } +bool has_hr_data(struct divecomputer *dc) +{ + int i; + struct sample *sample; + + if (!dc) + return false; + + sample = dc->sample; + for (i = 0; i < dc->samples; i++) + if (sample[i].heartbeat) + return true; + return false; +} + struct dive *alloc_dive(void) { struct dive *dive; @@ -2202,4 +2217,4 @@ void set_userid(char *rUserId) if (prefs.userid && rUserId) strcpy(prefs.userid, rUserId); } -#undef MAX_USERID_SIZE
\ No newline at end of file +#undef MAX_USERID_SIZE |