Fixed compiler warnings
This commit is contained in:
parent
ec99be4b7c
commit
627d3deed7
|
@ -207,7 +207,7 @@ gulp.task('embedVersion', function(cb)
|
||||||
headerFile += "const uint8_t VersionMajor = " + version.Major + ";\r\n";
|
headerFile += "const uint8_t VersionMajor = " + version.Major + ";\r\n";
|
||||||
headerFile += "const uint8_t VersionMinor = " + version.Minor + ";\r\n";
|
headerFile += "const uint8_t VersionMinor = " + version.Minor + ";\r\n";
|
||||||
headerFile += "const uint8_t VersionPatch = " + version.Patch + ";\r\n";
|
headerFile += "const uint8_t VersionPatch = " + version.Patch + ";\r\n";
|
||||||
headerFile += "const uint8_t VersionMetadata = " + version.BuildMetaData + ";\r\n";
|
headerFile += "const uint8_t VersionMetadata = " + (version.BuildMetaData ? version.BuildMetaData : '0') + ";\r\n";
|
||||||
|
|
||||||
headerFile += "const char VersionBranch[] = \"" + version.BranchName + "\";\r\n";
|
headerFile += "const char VersionBranch[] = \"" + version.BranchName + "\";\r\n";
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
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 = ;
|
const uint8_t VersionMetadata = 0;
|
||||||
const char VersionBranch[] = "develop";
|
const char VersionBranch[] = "develop";
|
||||||
const char VersionSemVer[] = "2.1.0-unstable.3";
|
const char VersionSemVer[] = "2.1.0-unstable.3";
|
||||||
const char VersionFullSemVer[] = "2.1.0-unstable.3";
|
const char VersionFullSemVer[] = "2.1.0-unstable.3";
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
* Stairs
|
||||||
|
* Copyright 2017 (c) Mark van Renswoude
|
||||||
|
*
|
||||||
|
* https://git.x2software.net/pub/Stairs
|
||||||
|
*/
|
||||||
|
#include "./config.h"
|
||||||
|
|
||||||
|
#ifdef SerialDebug
|
||||||
|
const uint32_t SerialDebugBaudrate = 115200;
|
||||||
|
const uint32_t SerialDebugStartupDelay = 2000;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
const char* ConnectionSettingsFile = "/connection.json";
|
||||||
|
const char* SystemSettingsFile = "/system.json";
|
||||||
|
const char* StepsSettingsFile = "/steps.json";
|
||||||
|
const char* TimeTriggerSettingsFile = "/timetriggers.json";
|
||||||
|
const char* MotionTriggerSettingsFile = "/motiontriggers.json";
|
||||||
|
|
||||||
|
|
||||||
|
const char* DefaultAPSSIDPrefix = "Stairs-";
|
||||||
|
|
||||||
|
const char* DefaultNTPServer = "pool.ntp.org";
|
||||||
|
|
||||||
|
// Timeout when in AP + station mode (otherwise trying to connect
|
||||||
|
// to the STA will block the AP)
|
||||||
|
const uint32_t StationModeTimeout = 30000;
|
||||||
|
|
||||||
|
const uint16_t APButtonHoldTime = 2000;
|
||||||
|
|
||||||
|
|
||||||
|
// Only used if the timezone has not been succesfully retrieved yet, otherwise
|
||||||
|
// the configurable NTP interval is used
|
||||||
|
const uint32_t TimezoneRetryInterval = 60000;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef MapsAPIViaProxyScript
|
||||||
|
const char* TimezoneProxyScriptHost = "api.x2software.net";
|
||||||
|
const char* TimezoneProxyScriptPath = "/timezone.php";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
const uint8_t InitialisationBrightness = 40;
|
||||||
|
const uint8_t InitialisationFadeTime = 250;
|
||||||
|
const uint8_t InitialisationBlinkCount = 2;
|
39
src/config.h
39
src/config.h
|
@ -20,32 +20,27 @@
|
||||||
|
|
||||||
|
|
||||||
#ifdef SerialDebug
|
#ifdef SerialDebug
|
||||||
static const uint32_t SerialDebugBaudrate = 115200;
|
extern const uint32_t SerialDebugBaudrate;
|
||||||
static const uint32_t SerialDebugStartupDelay = 2000;
|
extern const uint32_t SerialDebugStartupDelay;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static const char* ConnectionSettingsFile = "/connection.json";
|
extern const char* ConnectionSettingsFile;
|
||||||
static const char* SystemSettingsFile = "/system.json";
|
extern const char* SystemSettingsFile;
|
||||||
static const char* StepsSettingsFile = "/steps.json";
|
extern const char* StepsSettingsFile;
|
||||||
static const char* TimeTriggerSettingsFile = "/timetriggers.json";
|
extern const char* TimeTriggerSettingsFile;
|
||||||
static const char* MotionTriggerSettingsFile = "/motiontriggers.json";
|
extern const char* MotionTriggerSettingsFile;
|
||||||
|
|
||||||
|
|
||||||
static const char* DefaultAPSSIDPrefix = "Stairs-";
|
extern const char* DefaultAPSSIDPrefix;
|
||||||
|
|
||||||
static const char* DefaultNTPServer = "pool.ntp.org";
|
extern const char* DefaultNTPServer;
|
||||||
|
|
||||||
// Timeout when in AP + station mode (otherwise trying to connect
|
extern const uint32_t StationModeTimeout;
|
||||||
// to the STA will block the AP)
|
extern const uint16_t APButtonHoldTime;
|
||||||
static const uint32_t StationModeTimeout = 30000;
|
|
||||||
|
|
||||||
static const uint16_t APButtonHoldTime = 2000;
|
|
||||||
|
|
||||||
|
|
||||||
// Only used if the timezone has not been succesfully retrieved yet, otherwise
|
extern const uint32_t TimezoneRetryInterval;
|
||||||
// the configurable NTP interval is used
|
|
||||||
static const uint32_t TimezoneRetryInterval = 60000;
|
|
||||||
|
|
||||||
|
|
||||||
// SSL takes quite a bit of memory (and I haven't been optimizing much),
|
// SSL takes quite a bit of memory (and I haven't been optimizing much),
|
||||||
|
@ -66,13 +61,13 @@ static const uint32_t TimezoneRetryInterval = 60000;
|
||||||
#define MapsAPIViaProxyScript
|
#define MapsAPIViaProxyScript
|
||||||
|
|
||||||
#ifdef MapsAPIViaProxyScript
|
#ifdef MapsAPIViaProxyScript
|
||||||
static const char* TimezoneProxyScriptHost = "api.x2software.net";
|
extern const char* TimezoneProxyScriptHost;
|
||||||
static const char* TimezoneProxyScriptPath = "/timezone.php";
|
extern const char* TimezoneProxyScriptPath;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static const uint8_t InitialisationBrightness = 40;
|
extern const uint8_t InitialisationBrightness;
|
||||||
static const uint8_t InitialisationFadeTime = 250;
|
extern const uint8_t InitialisationFadeTime;
|
||||||
static const uint8_t InitialisationBlinkCount = 2;
|
extern const uint8_t InitialisationBlinkCount;
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -48,10 +48,10 @@ class StepsSettings : public AbstractJsonSettings
|
||||||
void useCurve(bool value) { mUseCurve = value; }
|
void useCurve(bool value) { mUseCurve = value; }
|
||||||
|
|
||||||
uint16_t rangeStart(uint8_t step) { return step < MaxStepCount ? mRange[step].start : 0; }
|
uint16_t rangeStart(uint8_t step) { return step < MaxStepCount ? mRange[step].start : 0; }
|
||||||
uint16_t rangeStart(uint8_t step, uint16_t value) { if (step < MaxStepCount) mRange[step].start = value; }
|
void rangeStart(uint8_t step, uint16_t value) { if (step < MaxStepCount) mRange[step].start = value; }
|
||||||
|
|
||||||
uint16_t rangeEnd(uint8_t step) { return step < MaxStepCount ? mRange[step].end : 0; }
|
uint16_t rangeEnd(uint8_t step) { return step < MaxStepCount ? mRange[step].end : 0; }
|
||||||
uint16_t rangeEnd(uint8_t step, uint16_t value) { if (step < MaxStepCount) mRange[step].end = value; }
|
void rangeEnd(uint8_t step, uint16_t value) { if (step < MaxStepCount) mRange[step].end = value; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -39,9 +39,8 @@ DayOfWeek toDayOfWeek(timeDayOfWeek_t timeDay)
|
||||||
case dowThursday: return Thursday;
|
case dowThursday: return Thursday;
|
||||||
case dowFriday: return Friday;
|
case dowFriday: return Friday;
|
||||||
case dowSaturday: return Saturday;
|
case dowSaturday: return Saturday;
|
||||||
|
default: return Monday;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Monday;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,6 +162,10 @@ TimeTrigger* TimeTriggerSettings::getActiveTrigger(tmElements_t &time)
|
||||||
case RelativeToSunset:
|
case RelativeToSunset:
|
||||||
triggerTime += sunsetMinutes;
|
triggerTime += sunsetMinutes;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FixedTime:
|
||||||
|
// No changes (but eliminates warning)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the current time is after the time set in the trigger, and
|
// Check if the current time is after the time set in the trigger, and
|
||||||
|
|
Loading…
Reference in New Issue