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

Active time store. It owns the tickers (the minute tick, the swatch .beats AppTimer, and the hour tick) and swaps between them for the current cadence, so a face just hands it the rules and reads the time back. More...

#include <pebble.h>
#include "clock/time_config.h"

Go to the source code of this file.

Functions

void time_store_init (TimeConfig cfg, const struct tm *seed)
 Start the store with its rules. Pass seed = NULL to start from the current time.
void time_store_reconfigure (TimeConfig cfg)
 Re-apply the rules (e.g. the time format changed). Swaps the ticker to match. Rules that run the same tickers as the ones running do nothing, so a face can call it on every settings save. Only init decides whether the store is live, so one init started with live = false keeps its pinned time whatever cfg says, and one never started ignores it. TimeConfig and the decisions live in clock/time_config.h.
void time_store_subscribe (void(*cb)(void))
 Hand it the function to call when the time changes (the screen redraw).
const struct tm * time_store_tm (void)
 The time we hold right now.

Detailed Description

Active time store. It owns the tickers (the minute tick, the swatch .beats AppTimer, and the hour tick) and swaps between them for the current cadence, so a face just hands it the rules and reads the time back.