Loading...
Searching...
No Matches
hrv_log.c File Reference

The heart rate variability readings kept for a face's panels. More...

#include "health/hrv_log.h"
#include <string.h>

Functions

void hrv_log_reset (HrvLog *log)
 Empties the log.
HrvState hrv_log_state_of (int motion_score, int steps, uint16_t still_mg, uint16_t walk_steps)
 Works out what a burst was from its steps and its movement score.
bool hrv_log_counts (HrvState state, HrvCount count)
 Whether a burst in one state counts for the main reading.
bool hrv_log_roll_day (HrvLog *log, int32_t day)
 Moves the hours on to a new day without a reading, so a day chart drawn after midnight does not show yesterday as today.
void hrv_log_add (HrvLog *log, int ms, uint32_t now_min, int32_t day, int minute_of_day, HrvState state, bool asleep)
 Files one finished reading.
int hrv_log_count (const HrvLog *log)
 How many readings the history holds, up to HRV_LOG_SLOTS.
bool hrv_log_get (const HrvLog *log, int back, int *ms, uint32_t *at_min, uint8_t *flags)
 One reading from the history, newest first.
int hrv_log_hour_avg (const HrvLog *log, int hour)
 Today's average of the resting readings in one hour.
void hrv_log_today (const HrvLog *log, int *low_ms, int *avg_ms, int *high_ms)
 Today's resting readings summed up.
int hrv_log_night_avg (const HrvLog *log)
 The average of the readings taken asleep in the latest night.
bool hrv_log_last (const HrvLog *log, HrvState state, int *ms, uint32_t *at_min)
 The latest reading of one kind.

Detailed Description

The heart rate variability readings kept for a face's panels.