diff options
-rw-r--r-- | dive.c | 17 | ||||
-rw-r--r-- | dive.h | 2 |
2 files changed, 18 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 @@ -743,6 +743,8 @@ extern void record_dive(struct dive *dive); extern struct sample *prepare_sample(struct divecomputer *dc); extern void finish_sample(struct divecomputer *dc); +extern bool has_hr_data(struct divecomputer *dc); + extern void sort_table(struct dive_table *table); extern struct dive *fixup_dive(struct dive *dive); extern int getUniqID(struct dive *d); |