Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
sunset_timer.h
Go to the documentation of this file.
1
5#ifndef UTILS_SUNSET_TIMER_H
6#define UTILS_SUNSET_TIMER_H
7
8#include <cstdint>
9
10namespace lampda {
11namespace logic {
13namespace sunset {
14
16void init();
17
23void set_deadline(const uint32_t timeshutdown_s);
24
29void add_time_minutes(const uint8_t time_minutes);
30
35
40void bump_timer();
41
43void cancel_timer();
44
46bool is_enabled();
47
49void lock_brightness_update(bool shouldLock);
50
51} // namespace sunset
52} // namespace logic
53} // namespace lampda
54
55#endif
void lock_brightness_update(bool shouldLock)
Lock the hability of the sunset timer to control the brightness.
Definition: sunset_timer.cpp:245
void set_deadline(const uint32_t timeshutdown_s)
Set the sunset timer to a known clock deadline, replacing existing timers. Start the timer,...
Definition: sunset_timer.cpp:128
void bump_timer()
signal to the timer that some time may be added. Only add time if the timer is in the fadeout phase
Definition: sunset_timer.cpp:204
void add_time_minutes(const uint8_t time_minutes)
add some time to the sunset timer. Limited in the range [1; 10] minutes. If the timer is not started ...
Definition: sunset_timer.cpp:168
void shortcut_to_phaseout()
If a timer is enabled, shortcut it to the start of the shutdown animation.
Definition: sunset_timer.cpp:190
void cancel_timer()
cancel the current active timer
Definition: sunset_timer.cpp:228
void init()
call once on program start
Definition: sunset_timer.cpp:122
bool is_enabled()
Indicate if the sunset is set.
Definition: sunset_timer.cpp:24
Program scope.
Definition: control_fixed_modes.hpp:12