mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 10:19:29 +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) {
|
void LED::flow_run(void) {
|
||||||
// Determine how bright the LED should be
|
// Determine how bright the LED should be
|
||||||
int16_t power_W = datalayer.battery.status.active_power_W;
|
if (datalayer.battery.status.active_power_W < -50) {
|
||||||
if (power_W < -50) {
|
|
||||||
// Discharging
|
// Discharging
|
||||||
brightness = max_brightness - up_down(0.95);
|
brightness = max_brightness - up_down(0.95);
|
||||||
} else if (power_W > 50) {
|
} else if (datalayer.battery.status.active_power_W > 50) {
|
||||||
// Charging
|
// Charging
|
||||||
brightness = up_down(0.95);
|
brightness = up_down(0.95);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue