Skip pv screen if no generation
This commit is contained in:
parent
091fe5c926
commit
70d53bb2af
16
src/main.cpp
16
src/main.cpp
|
@ -499,11 +499,19 @@ void loop() {
|
|||
display_screen++;
|
||||
lastScreenChangeTime += DISPLAY_SCREEN_INTERVAL;
|
||||
if (display_screen == display_last_screen + 1)
|
||||
{
|
||||
//If no pv power generated, skip PV charger screen
|
||||
if (pv_kwh == 0)
|
||||
{
|
||||
display_screen = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
display_screen = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Rotate screen if BUTTON_ROTATION is pressed
|
||||
currentButtonRotationState = digitalRead(BUTTON_ROTATION);
|
||||
|
@ -511,9 +519,17 @@ void loop() {
|
|||
{
|
||||
display_screen++;
|
||||
if (display_screen == display_last_screen + 1)
|
||||
{
|
||||
//If no pv power generated, skip PV charger screen
|
||||
if (pv_kwh == 0)
|
||||
{
|
||||
display_screen = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
display_screen = 0;
|
||||
}
|
||||
}
|
||||
lastButtonRotationState = currentButtonRotationState;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue