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

Handle the indicator brightness. More...

Functions

void set_brightness_level (const uint8_t level)
 Set the brightness of the RGB indicator. Indicator level can be 0 : indicator and alerts displayed at full brightness 1 : indicator and alerts displayed at low brightness 2 : indicator and alerts displayed at low brightness, indicator off when charging After a level update, the normal indicator stays visible for 5 seconds, even while charging at level 2.
 
uint8_t get_brightness_level ()
 Get the brightness of the RGB indicator. Indicator level can be 0 : indicator and alerts displayed at full brightness 1 : indicator and alerts displayed at low brightness 2 : indicator and alerts displayed at low brightness, indicator off when charging After a level update, the normal indicator stays visible for 5 seconds, even while charging at level 2.
 
bool should_indicator_be_visible ()
 indicates if the indicator should be visible or not
 
void set_color_override (const uint8_t red, const uint8_t green, const uint8_t blue)
 Replace the battery level color of the indicator by a fixed color. The indicator animations (charge, output, ...) are kept, only their color changes. Alerts are not affected and always take precedence. This color is not saved.
 
void clear_color_override ()
 Restore the default (battery level) color of the indicator.
 
bool get_color_override (uint32_t &color)
 Get the color that replaces the battery level color, if any.
 

Variables

static uint8_t _level = 0
 Internal indicator brightness level (1-3)
 
static uint32_t levelUpdateTime = 0
 
static bool _hasColorOverride = false
 
static uint32_t _colorOverride = 0
 

Detailed Description

Handle the indicator brightness.

Function Documentation

◆ get_color_override()

bool lampda::logic::indicator::get_color_override ( uint32_t &  color)

Get the color that replaces the battery level color, if any.

Parameters
[out]colorThe override color, as a 0xRRGGBB value. Untouched if there is no override.
Returns
true if an override color is set