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>
This commit is contained in:
Dirk Hohndel 2014-04-24 13:58:39 -07:00
parent 0785a7f0ca
commit 0be8512ab0
2 changed files with 18 additions and 1 deletions

17
dive.c
View file

@ -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
#undef MAX_USERID_SIZE