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

The daily goal tables, host-testable off-device. More...

#include "health/goals.h"

Functions

static int goal_at (const int16_t *table, uint8_t count, uint8_t index)
 A table's entry for a menu choice, or its first entry for a choice past the end.
int goals_steps (uint8_t index)
 The step goal for a menu choice.
int goals_distance_m (uint8_t index)
 The distance goal for a menu choice, in metres.
int goals_calories (uint8_t index)
 The active calorie goal for a menu choice.
int goals_active_min (uint8_t index)
 The active minutes goal for a menu choice.
int goals_sleep_min (uint8_t index)
 The sleep goal for a menu choice, in minutes.
int goals_hr_limit (uint8_t index)
 The heart rate limit for a menu choice, the top of a heart rate bar.

Variables

static const int16_t s_steps [] = {5000, 7500, 10000, 12500, 15000, 20000, 25000}
 step goals
static const int16_t s_distance_m [] = {2000, 3000, 5000, 8000, 10000, 15000, 20000}
 distance goals in metres, from the page's km
static const int16_t s_calories [] = {500, 1000, 1500, 2000, 2500, 3000}
 active calorie goals in kcal
static const int16_t s_active_min [] = {15, 30, 45, 60, 90}
 active minute goals
static const int16_t s_sleep_h [] = {6, 7, 8, 9, 10}
 sleep goals in hours
static const int16_t s_hr_limits [] = {150, 160, 170, 180, 190, 200}
 heart rate limits in bpm

Detailed Description

The daily goal tables, host-testable off-device.

goal-rows.spec.ts reads these tables as text and checks them against the page's, so each one stays a plain list of numbers.

Function Documentation

◆ goal_at()

int goal_at ( const int16_t * table,
uint8_t count,
uint8_t index )
static

A table's entry for a menu choice, or its first entry for a choice past the end.

Parameters
tableThe goals, in menu order.
countHow many the table holds.
indexThe saved choice.
Returns
The goal.