mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Make LED modes customizable
This commit is contained in:
parent
65239677ee
commit
69af8251b8
6 changed files with 21 additions and 27 deletions
|
@ -16,7 +16,7 @@ static const float heartbeat_peak1 = 0.80;
|
|||
static const float heartbeat_peak2 = 0.55;
|
||||
static const float heartbeat_deviation = 0.05;
|
||||
|
||||
static LED led(LED_MODE_DEFAULT);
|
||||
static LED led(datalayer.battery.status.led_mode);
|
||||
|
||||
void led_init(void) {
|
||||
led.init();
|
||||
|
@ -31,14 +31,14 @@ led_color led_get_color() {
|
|||
void LED::exe(void) {
|
||||
|
||||
// Update brightness
|
||||
switch (mode) {
|
||||
case led_mode::FLOW:
|
||||
switch (datalayer.battery.status.led_mode) {
|
||||
case led_mode_enum::FLOW:
|
||||
flow_run();
|
||||
break;
|
||||
case led_mode::HEARTBEAT:
|
||||
case led_mode_enum::HEARTBEAT:
|
||||
heartbeat_run();
|
||||
break;
|
||||
case led_mode::CLASSIC:
|
||||
case led_mode_enum::CLASSIC:
|
||||
default:
|
||||
classic_run();
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue