Loading...
Searching...
No Matches
nightsched.h
Go to the documentation of this file.
1
17#pragma once
18#include <stdbool.h>
19
24
26typedef enum
27{
31 NIGHT_SCHED_COUNT
33
46bool clock_window_contains(int start, int end, int now);
47
64bool night_schedule_active(int mode, int now, int rise, int set,
65 int fixed_start, int fixed_end, bool have_night);
66
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
What the schedule is following. The caller's own enum should line up with these.
Definition nightsched.h:27
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
Sunset to sunrise, falling back to the fixed pair with no reading.
Definition nightsched.h:29
@ NIGHT_SCHED_OFF
Never night.
Definition nightsched.h:28
@ NIGHT_SCHED_FIXED
The fixed pair only.
Definition nightsched.h:30