Loading...
Searching...
No Matches
hr_day.h File Reference

Today's heart rate by the hour, for a panel that charts the day with its low, average, and high. More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  HrHour
 The readings that landed in one hour. More...
struct  HrDay
 Today's heart rate, one entry an hour from midnight. More...

Macros

#define HR_DAY_HOURS   24
 Today's hours from midnight.

Functions

void hr_day_clear (HrDay *day)
 Empties the day, for a new day or a fresh start.
void hr_day_add (HrDay *day, int hour, int bpm)
 Adds one reading to its hour.
int hr_day_hour_avg (const HrDay *day, int hour)
 The average of one hour's readings.
void hr_day_stats (const HrDay *day, int *low, int *avg, int *high)
 The day's lowest and highest readings, and the average of every reading so far.

Detailed Description

Today's heart rate by the hour, for a panel that charts the day with its low, average, and high.

The health store fills it from the watch's minute log at launch and from each new reading after. Plain C with no SDK, so its specs run on a PC. The caller passes the hour already worked out, so a clock change is decided once, where the clock is read.