Fixed initialisation of step ranges

Added "always update" flag to update server
This commit is contained in:
Mark van Renswoude 2017-04-16 16:10:42 +02:00
parent c789fd259b
commit 98fd68eeee
2 changed files with 9 additions and 1 deletions

View File

@ -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;

View File

@ -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;