Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Classes | Namespaces | Functions | Variables
battery_blink.h File Reference

Blink the main output when the battery level goes under a threshold. More...

Go to the source code of this file.

Classes

class  lampda::logic::battery_blink::BlinkTracker
 Decide when to blink, independently of the hardware. More...
 

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::logic
 Handle the main high level logics.
 
 

Functions

constexpr uint8_t lampda::logic::battery_blink::get_blink_count (const uint16_t level)
 Return the number of blinks of a battery level.
 
void lampda::logic::battery_blink::signal_output_on ()
 Call when the output mode is entered.
 
void lampda::logic::battery_blink::loop ()
 Call on each main loop of the output mode, before the user loop.
 
void lampda::logic::battery_blink::set_enabled (const bool isEnabled)
 Enable or disable the blinks. Saved with the system parameters.
 
bool lampda::logic::battery_blink::is_enabled ()
 Return true if the blinks are enabled.
 

Variables

static constexpr uint32_t lampda::logic::battery_blink::levelFilterWindow_ms = 1000
 A level must be held for this time to be displayed, the voltage drops on high current use.
 
static constexpr uint32_t lampda::logic::battery_blink::minOutputUseTime_ms = 10000
 A level passed before this output use time is never displayed.
 
static constexpr uint32_t lampda::logic::battery_blink::blinkOffTime_ms = 50
 Time the output is off during a blink.
 
static constexpr uint32_t lampda::logic::battery_blink::blinkPeriod_ms = 150
 Time between the start of two successive blinks.
 

Detailed Description

Blink the main output when the battery level goes under a threshold.