Some improvements.

This commit is contained in:
matzman
2018-03-17 21:53:38 +01:00
parent c8e0acf911
commit 8c7417dc7b
6 changed files with 287 additions and 84 deletions
+23
View File
@@ -8,6 +8,24 @@
#include "NotificationLEDs.h"
template<
uint8_t _tpin,
uint8_t _trgbwId,
uint8_t _tdimmerId,
uint8_t _tpowerSwitchId,
uint8_t _tcommandId,
uint16_t _tpixelCount,
unsigned long _msgSendInterval
> void NotificationLEDs<_tpin, _trgbwId, _tdimmerId, _tpowerSwitchId, _tcommandId, _tpixelCount, _msgSendInterval>
::analogClock_setup() noexcept {
_eeprom_NotificationLEDs_StatusTable statusTable;
statusTable.data = loadState(EEPROM_POS_STATUSTABLE);
if (statusTable.status.hourOffset == 1) {
sceneData.analogClock.hourOffset = (int8_t)loadState(EEPROM_POS_HOUROFFSET);
}
}
template<
uint8_t _tpin,
uint8_t _trgbwId,
@@ -22,6 +40,11 @@ template<
if (token && token[0] != ' ') {
auto offset = atoi(token);
sceneData.analogClock.hourOffset = offset;
_eeprom_NotificationLEDs_StatusTable statusTable;
statusTable.data = loadState(EEPROM_POS_STATUSTABLE);
statusTable.status.hourOffset = 1;
saveState(EEPROM_POS_HOUROFFSET, offset);
saveState(EEPROM_POS_STATUSTABLE, statusTable.data);
}
token = strtok(NULL, _configDelims);
if (token && token[0] != ' ') {