Pebble App Framework
main
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
time_store.h
Go to the documentation of this file.
1
9
#pragma once
10
#include <pebble.h>
11
16
26
typedef
struct
27
{
28
bool
live
;
29
bool
minute_tick
;
30
bool
beats
;
31
bool
hourly
;
32
}
TimeConfig
;
33
40
void
time_store_init
(
TimeConfig
cfg,
const
struct
tm *seed);
41
47
void
time_store_reconfigure
(
TimeConfig
cfg);
48
50
void
time_store_subscribe
(
void
(*cb)(
void
));
51
53
const
struct
tm *
time_store_tm
(
void
);
54
time_store_init
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.
Definition
time_store.c:119
time_store_subscribe
void time_store_subscribe(void(*cb)(void))
Hand it the function to call when the time changes (the screen redraw).
Definition
time_store.c:114
time_store_reconfigure
void time_store_reconfigure(TimeConfig cfg)
Re-apply the rules (e.g. the time format changed). Swaps the ticker to match.
Definition
time_store.c:143
time_store_tm
const struct tm * time_store_tm(void)
The time we hold right now.
Definition
time_store.c:159
TimeConfig
The rules a face hands the store, built from its own settings so the store names no SETTING_*.
Definition
time_store.h:27
TimeConfig::minute_tick
bool minute_tick
Run the minute tick (clock date and most readouts).
Definition
time_store.h:29
TimeConfig::beats
bool beats
Also run the 86.4 second .beats timer for a live .beats readout.
Definition
time_store.h:30
TimeConfig::hourly
bool hourly
With the minute tick off, still wake at the top of each hour, such as for an hourly buzz.
Definition
time_store.h:31
TimeConfig::live
bool live
True runs the tickers and false freezes the clock for screenshots.
Definition
time_store.h:28
src
c
pebble
io
stores
time_store.h
Generated by
1.18.0