mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 02:09:30 +02:00
Remove intermediate variable to save memory
This commit is contained in:
parent
64e633f10f
commit
77d83e5eb1
1 changed files with 2 additions and 3 deletions
|
@ -92,11 +92,10 @@ void LED::classic_run(void) {
|
|||
|
||||
void LED::flow_run(void) {
|
||||
// Determine how bright the LED should be
|
||||
int16_t power_W = datalayer.battery.status.active_power_W;
|
||||
if (power_W < -50) {
|
||||
if (datalayer.battery.status.active_power_W < -50) {
|
||||
// Discharging
|
||||
brightness = max_brightness - up_down(0.95);
|
||||
} else if (power_W > 50) {
|
||||
} else if (datalayer.battery.status.active_power_W > 50) {
|
||||
// Charging
|
||||
brightness = up_down(0.95);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue