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
nightsched.h
Go to the documentation of this file.
1
17
#pragma once
18
#include <stdbool.h>
19
24
26
typedef
enum
27
{
28
NIGHT_SCHED_OFF
= 0,
29
NIGHT_SCHED_SOLAR
,
30
NIGHT_SCHED_FIXED
,
31
NIGHT_SCHED_COUNT
32
}
NightSchedMode
;
33
46
bool
clock_window_contains
(
int
start,
int
end,
int
now);
47
64
bool
night_schedule_active
(
int
mode,
int
now,
int
rise,
int
set,
65
int
fixed_start,
int
fixed_end,
bool
have_night);
66
clock_window_contains
bool clock_window_contains(int start, int end, int now)
Whether now falls inside a window that may run past midnight.
Definition
nightsched.c:18
NightSchedMode
NightSchedMode
What the schedule is following. The caller's own enum should line up with these.
Definition
nightsched.h:27
night_schedule_active
bool night_schedule_active(int mode, int now, int rise, int set, int fixed_start, int fixed_end, bool have_night)
Whether the night window is open, whichever way the schedule is set.
Definition
nightsched.c:40
NIGHT_SCHED_SOLAR
@ NIGHT_SCHED_SOLAR
Sunset to sunrise, falling back to the fixed pair with no reading.
Definition
nightsched.h:29
NIGHT_SCHED_OFF
@ NIGHT_SCHED_OFF
Never night.
Definition
nightsched.h:28
NIGHT_SCHED_FIXED
@ NIGHT_SCHED_FIXED
The fixed pair only.
Definition
nightsched.h:30
src
c
core
clock
nightsched.h
Generated by
1.18.0