From 98fd68eeeec25f19fde169a50cef8368c1cfafa1 Mon Sep 17 00:00:00 2001 From: Mark van Renswoude Date: Sun, 16 Apr 2017 16:10:42 +0200 Subject: [PATCH] Fixed initialisation of step ranges Added "always update" flag to update server --- src/stairs.cpp | 7 ++++++- web/app.js | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/stairs.cpp b/src/stairs.cpp index ae8349e..1a60ce8 100644 --- a/src/stairs.cpp +++ b/src/stairs.cpp @@ -18,7 +18,12 @@ struct Header void Stairs::init(PCA9685* pwmDriver) { this->useScaling = false; - memset(this->ranges, 0, sizeof(this->ranges)); + + for (uint8_t i = 0; i < StepCount; i++) + { + this->ranges[i].start = IStairs::Off; + this->ranges[i].end = IStairs::On; + } this->pwmDriver = pwmDriver; diff --git a/web/app.js b/web/app.js index 42f3029..b4e38b7 100644 --- a/web/app.js +++ b/web/app.js @@ -10,6 +10,7 @@ var stairsHost = '10.138.2.25'; var stairsUdpPort = 3126; var firmwareFile = './update/firmware.bin'; +var alwaysUpdate = true; function requireNoCache(filename) @@ -21,6 +22,8 @@ function requireNoCache(filename) function isNewer(version1, version2) { + if (alwaysUpdate) return true; + if (version1.major > version2.major) return true; if (version1.major < version2.major) return false;