Pebble App Framework
v4.6.0
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
beats.h
Go to the documentation of this file.
1
8
#pragma once
9
#include <stdbool.h>
10
#include <stdint.h>
11
12
// shared time constants for the .beats clock and the BMT conversion
13
#define MS_PER_BEAT 86400
14
#define MS_PER_DAY 86400000
15
#define MS_PER_SEC 1000
16
#define SECS_PER_DAY 86400
17
#define SECS_PER_HOUR 3600
18
#define SECS_PER_MIN 60
19
#define BMT_UTC_OFFSET_S 3600
20
31
#define BEATS_TOKEN "{B}"
32
#define BEATS_TOKEN_LEN 3
33
38
45
int
beats_from_ms
(int32_t ms_into_bmt_day);
46
56
uint32_t
ms_until_next_beat
(int32_t ms_into_bmt_day);
57
75
int32_t
beats_ms_from_hms
(
int
hour,
int
minute,
int
second, uint16_t ms);
76
87
bool
beats_has_token
(
const
char
*format);
88
99
void
beats_expand_token
(
char
*text,
int
beats);
100
beats_expand_token
void beats_expand_token(char *text, int beats)
Overwrite every BEATS_TOKEN in a string with a three digit .beats reading.
Definition
beats.c:73
beats_ms_from_hms
int32_t beats_ms_from_hms(int hour, int minute, int second, uint16_t ms)
Milliseconds into the Biel Mean Time day, from a UTC wall clock.
Definition
beats.c:37
beats_from_ms
int beats_from_ms(int32_t ms_into_bmt_day)
Calculates swatch internet time in .beats (0..999) for a given ms.
Definition
beats.c:12
ms_until_next_beat
uint32_t ms_until_next_beat(int32_t ms_into_bmt_day)
Calculates milliseconds until the next .beats boundary.
Definition
beats.c:22
beats_has_token
bool beats_has_token(const char *format)
Whether a date format asks for a .beats reading.
Definition
beats.c:68
src
c
core
clock
beats.h
Generated by
1.18.0