From bcaeb032b87bf8a37410b8ea8a8a94c87d350429 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Sun, 29 Apr 2018 10:13:24 +0200 Subject: [PATCH] Fixed endless loop in startup transition --- src/assets/version.h | 10 +++++----- src/config.cpp | 2 +- src/main.cpp | 15 +++++++++++++-- web/site.scss | 8 +++++++- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/assets/version.h b/src/assets/version.h index 563e4f5..f43427e 100644 --- a/src/assets/version.h +++ b/src/assets/version.h @@ -4,10 +4,10 @@ const uint8_t VersionMajor = 2; const uint8_t VersionMinor = 1; const uint8_t VersionPatch = 0; -const uint8_t VersionMetadata = 0; -const char VersionBranch[] = "develop"; -const char VersionSemVer[] = "2.1.0-unstable.3"; -const char VersionFullSemVer[] = "2.1.0-unstable.3"; -const char VersionCommitDate[] = "2018-04-22"; +const uint8_t VersionMetadata = 1; +const char VersionBranch[] = "release/2.1"; +const char VersionSemVer[] = "2.1.0-beta.1"; +const char VersionFullSemVer[] = "2.1.0-beta.1+1"; +const char VersionCommitDate[] = "2018-04-29"; #endif diff --git a/src/config.cpp b/src/config.cpp index 3e289ac..a6c3a4a 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -41,6 +41,6 @@ const char* TimezoneProxyScriptPath = "/timezone.php"; #endif -const uint8_t InitialisationBrightness = 40; +const uint8_t InitialisationBrightness = 128; const uint8_t InitialisationFadeTime = 250; const uint8_t InitialisationBlinkCount = 2; diff --git a/src/main.cpp b/src/main.cpp index cd1632a..2e4c9e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,6 +44,17 @@ AsyncWebServer server(80); PCA9685* pwmDriver; +inline void waitForTransition() +{ + while (stairs->inTransition()) + { + currentTime = millis(); + stairs->tick(); + delay(1); + } +} + + void setup() { _dinit(); @@ -81,10 +92,10 @@ void setup() for (uint8_t i = 0; i < InitialisationBlinkCount; i++) { stairs->set(bottomStep, InitialisationBrightness, InitialisationFadeTime); - while (stairs->inTransition()) { stairs->tick(); delay(1); } + waitForTransition(); stairs->set(bottomStep, 0, InitialisationFadeTime); - while (stairs->inTransition()) { stairs->tick(); delay(1); } + waitForTransition(); } _dln("Setup :: initializing WiFi"); diff --git a/web/site.scss b/web/site.scss index 54c1eae..1a54297 100644 --- a/web/site.scss +++ b/web/site.scss @@ -127,13 +127,19 @@ button, input font-family: 'Verdana', 'Arial', sans-serif; } -input + +@mixin removeSafariStyling { -webkit-appearance: none; -moz-appearance: none; appearance: none; } +input +{ + @include removeSafariStyling; +} + button, .button, input[type=submit] { @extend %outset;