Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Functions | Variables
lampda::logic::sunset Namespace Reference

Sunset timer handler. More...

Functions

uint32_t get_sunset_loop_timing_ms ()
 
float get_percent_of_advance ()
 Return the percent of advance of the sunset timer, from 0 to 1. 1 is end of process.
 
float signal_sunset_update ()
 Send the timer update signal to consummers Returns the progress.
 
void sunset_process_loop ()
 
void init ()
 call once on program start
 
void add_time_minutes (const uint8_t time_minutes)
 add some time to the sunset timer. Limited to 10 minutes
 
void bump_timer ()
 signal to the timer that some time must be added. Limited to 10 minutes
 
void cancel_timer ()
 cancel the current active timer
 
bool is_enabled ()
 True if timer is running.
 
void lock_brightness_update (bool shouldLock)
 Lock the hability of the sunset timer to control the brightness.
 

Variables

uint32_t sunsetTimerEndTime_s = 0
 
bool isAllowedToControlBrightness = true
 
static constexpr uint32_t brightnessRampDownTime_min = 3
 
static constexpr uint32_t brightnessRampDownTime_s = brightnessRampDownTime_min * 60
 
static constexpr uint32_t brightnessRampDownTime_ms = brightnessRampDownTime_s * 1000
 
static constexpr uint16_t brightnessDecreasePerLoop = 1
 
static constexpr uint16_t minimalSunsetUpdateCalls = 50
 
const char *const sunset_taskName = "sunset"
 

Detailed Description

Sunset timer handler.

Function Documentation

◆ bump_timer()

void lampda::logic::sunset::bump_timer ( )

signal to the timer that some time must be added. Limited to 10 minutes

signal to the timer that some time may be added