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
hour_latch.h
Go to the documentation of this file.
1
12
#pragma once
13
#include <stdbool.h>
14
#include <time.h>
15
20
24
typedef
struct
25
{
26
time_t
last_start
;
27
}
HourLatch
;
28
29
#define HOUR_LATCH_EMPTY {.last_start = -1}
30
43
time_t
hour_latch_start
(time_t now,
int
tm_min,
int
tm_sec);
44
53
bool
hour_latch_take
(
HourLatch
*latch,
int
tick_min, time_t start);
54
61
void
hour_latch_seed
(
HourLatch
*latch, time_t start);
62
hour_latch_seed
void hour_latch_seed(HourLatch *latch, time_t start)
Marks an hour as buzzed without buzzing it.
Definition
hour_latch.c:25
hour_latch_start
time_t hour_latch_start(time_t now, int tm_min, int tm_sec)
When the local hour holding a moment began, as seconds since the epoch.
Definition
hour_latch.c:9
hour_latch_take
bool hour_latch_take(HourLatch *latch, int tick_min, time_t start)
Whether a tick should buzz the hour, and if so, marks the hour as buzzed.
Definition
hour_latch.c:14
HourLatch
Remembers the hour that last buzzed.
Definition
hour_latch.h:25
HourLatch::last_start
time_t last_start
when the hour that last buzzed began, or -1 before any has
Definition
hour_latch.h:26
src
c
core
clock
hour_latch.h
Generated by
1.18.0