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

The daily goals a wearer picks on the settings page, turned from a menu choice into the real target. More...

#include <stdint.h>

Go to the source code of this file.

Macros

#define GOALS_STEPS_COUNT   7
 How many step goals the page offers, from 5,000 to 25,000.
#define GOALS_DISTANCE_COUNT   7
 How many distance goals the page offers, from 2 km to 20 km.
#define GOALS_CALORIES_COUNT   6
 How many calorie goals the page offers, from 500 to 3,000 kcal.
#define GOALS_ACTIVE_COUNT   5
 How many active minute goals the page offers, from 15 to 90 minutes.
#define GOALS_SLEEP_COUNT   5
 How many sleep goals the page offers, from 6 to 10 hours.
#define GOALS_HR_COUNT   6
 How many heart rate limits the page offers, from 150 to 200 bpm.

Functions

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.

Detailed Description

The daily goals a wearer picks on the settings page, turned from a menu choice into the real target.

The page sends the index of the choice rather than the number, and these tables hold the numbers in the same order as the page's menus. The page's rows live in ts/pkjs/goal-rows.ts, and a spec checks the two sides hold the same values in the same order. An index past the end of a table reads as its first entry, so a damaged setting still gives a real goal.

Each table's length is a plain number the compiler knows, so a KNOWN_GOAL_* entry can hold its setting to it.