Decide on UDP or animation display after showing IP for 30 seconds
This commit is contained in:
parent
89160ed482
commit
ecfc78c48a
16
src/main.cpp
16
src/main.cpp
|
@ -188,21 +188,21 @@ static void ledFSM(void)
|
||||||
|
|
||||||
animController.loop();
|
animController.loop();
|
||||||
|
|
||||||
|
// change to last used animation or UDP visualization after some time
|
||||||
|
if((millis() - stateEnteredTime) > 30000) {
|
||||||
|
// load the saved animation
|
||||||
|
// FIXME: does not work with transition because of restart() call in ANIMATION state
|
||||||
|
animController.changeAnimation(loadSavedAnimation(), false);
|
||||||
|
|
||||||
if(((WiFi.status() == WL_CONNECTED) || (WiFi.getMode() == WIFI_MODE_AP)) &&
|
if(((WiFi.status() == WL_CONNECTED) || (WiFi.getMode() == WIFI_MODE_AP)) &&
|
||||||
udpProto.check()) {
|
udpProto.check()) {
|
||||||
// UDP packet received -> transition to UDP state
|
// UDP packet received -> transition to UDP state
|
||||||
nextState = UDP;
|
nextState = UDP;
|
||||||
ledState = TRANSITION;
|
ledState = TRANSITION;
|
||||||
// ensure the correct animation plays after UDP transfers stop
|
} else {
|
||||||
animController.changeAnimation(loadSavedAnimation(), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// change to last used animation after some time
|
|
||||||
if((millis() - stateEnteredTime) > 60000) {
|
|
||||||
// FIXME: does not work with transition because of restart() call in ANIMATION state
|
|
||||||
animController.changeAnimation(loadSavedAnimation(), false);
|
|
||||||
ledState = ANIMATION;
|
ledState = ANIMATION;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANIMATION:
|
case ANIMATION:
|
||||||
|
|
Loading…
Reference in a new issue