Fixed endless loop in startup transition

This commit is contained in:
Mark van Renswoude 2018-04-29 10:13:24 +02:00
parent 627d3deed7
commit bcaeb032b8
4 changed files with 26 additions and 9 deletions

View File

@ -4,10 +4,10 @@
const uint8_t VersionMajor = 2; const uint8_t VersionMajor = 2;
const uint8_t VersionMinor = 1; const uint8_t VersionMinor = 1;
const uint8_t VersionPatch = 0; const uint8_t VersionPatch = 0;
const uint8_t VersionMetadata = 0; const uint8_t VersionMetadata = 1;
const char VersionBranch[] = "develop"; const char VersionBranch[] = "release/2.1";
const char VersionSemVer[] = "2.1.0-unstable.3"; const char VersionSemVer[] = "2.1.0-beta.1";
const char VersionFullSemVer[] = "2.1.0-unstable.3"; const char VersionFullSemVer[] = "2.1.0-beta.1+1";
const char VersionCommitDate[] = "2018-04-22"; const char VersionCommitDate[] = "2018-04-29";
#endif #endif

View File

@ -41,6 +41,6 @@ const char* TimezoneProxyScriptPath = "/timezone.php";
#endif #endif
const uint8_t InitialisationBrightness = 40; const uint8_t InitialisationBrightness = 128;
const uint8_t InitialisationFadeTime = 250; const uint8_t InitialisationFadeTime = 250;
const uint8_t InitialisationBlinkCount = 2; const uint8_t InitialisationBlinkCount = 2;

View File

@ -44,6 +44,17 @@ AsyncWebServer server(80);
PCA9685* pwmDriver; PCA9685* pwmDriver;
inline void waitForTransition()
{
while (stairs->inTransition())
{
currentTime = millis();
stairs->tick();
delay(1);
}
}
void setup() void setup()
{ {
_dinit(); _dinit();
@ -81,10 +92,10 @@ void setup()
for (uint8_t i = 0; i < InitialisationBlinkCount; i++) for (uint8_t i = 0; i < InitialisationBlinkCount; i++)
{ {
stairs->set(bottomStep, InitialisationBrightness, InitialisationFadeTime); stairs->set(bottomStep, InitialisationBrightness, InitialisationFadeTime);
while (stairs->inTransition()) { stairs->tick(); delay(1); } waitForTransition();
stairs->set(bottomStep, 0, InitialisationFadeTime); stairs->set(bottomStep, 0, InitialisationFadeTime);
while (stairs->inTransition()) { stairs->tick(); delay(1); } waitForTransition();
} }
_dln("Setup :: initializing WiFi"); _dln("Setup :: initializing WiFi");

View File

@ -127,13 +127,19 @@ button, input
font-family: 'Verdana', 'Arial', sans-serif; font-family: 'Verdana', 'Arial', sans-serif;
} }
input
@mixin removeSafariStyling
{ {
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
} }
input
{
@include removeSafariStyling;
}
button, .button, input[type=submit] button, .button, input[type=submit]
{ {
@extend %outset; @extend %outset;