Pebble App Framework
v7.1.1
How It Works
CLI
Device API
Phone API
C Coverage
TS Coverage
GitHub
Theme
Pebble App Framework: Device API
Toggle main menu visibility
Loading...
Searching...
No Matches
hr_day.h
Go to the documentation of this file.
1
12
#pragma once
13
#include <stdbool.h>
14
#include <stdint.h>
15
20
21
#define HR_DAY_HOURS 24
22
24
typedef
struct
25
{
26
uint16_t
sum
;
27
uint8_t
count
;
28
uint8_t
low
;
29
uint8_t
high
;
30
}
HrHour
;
31
33
typedef
struct
34
{
35
HrHour
hours
[
HR_DAY_HOURS
];
36
}
HrDay
;
37
43
void
hr_day_clear
(
HrDay
*day);
44
56
void
hr_day_add
(
HrDay
*day,
int
hour,
int
bpm);
57
65
int
hr_day_hour_avg
(
const
HrDay
*day,
int
hour);
66
78
void
hr_day_stats
(
const
HrDay
*day,
int
*low,
int
*avg,
int
*high);
79
hr_day_clear
void hr_day_clear(HrDay *day)
Empties the day, for a new day or a fresh start.
Definition
hr_day.c:9
hr_day_add
void hr_day_add(HrDay *day, int hour, int bpm)
Adds one reading to its hour.
Definition
hr_day.c:14
hr_day_stats
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.
Definition
hr_day.c:58
hr_day_hour_avg
int hr_day_hour_avg(const HrDay *day, int hour)
The average of one hour's readings.
Definition
hr_day.c:42
HR_DAY_HOURS
#define HR_DAY_HOURS
Today's hours from midnight.
Definition
hr_day.h:21
HrDay
Today's heart rate, one entry an hour from midnight.
Definition
hr_day.h:34
HrDay::hours
HrHour hours[HR_DAY_HOURS]
Each hour's readings, midnight first.
Definition
hr_day.h:35
HrHour
The readings that landed in one hour.
Definition
hr_day.h:25
HrHour::high
uint8_t high
The highest reading.
Definition
hr_day.h:29
HrHour::count
uint8_t count
How many readings, or 0 for an hour with none.
Definition
hr_day.h:27
HrHour::low
uint8_t low
The lowest reading.
Definition
hr_day.h:28
HrHour::sum
uint16_t sum
The readings added together.
Definition
hr_day.h:26
src
c
core
health
hr_day.h
Generated by
1.18.0