mirror of
https://github.com/wled/WLED.git
synced 2025-07-15 14:56:32 +00:00
Bugfixes.
This commit is contained in:
parent
43677685bb
commit
8320ed5a92
@ -287,10 +287,6 @@ class BusPwm : public Bus {
|
|||||||
uint8_t getPins(uint8_t* pinArray) {
|
uint8_t getPins(uint8_t* pinArray) {
|
||||||
uint8_t numPins = NUM_PWM_PINS(_type);
|
uint8_t numPins = NUM_PWM_PINS(_type);
|
||||||
for (uint8_t i = 0; i < numPins; i++) {
|
for (uint8_t i = 0; i < numPins; i++) {
|
||||||
#ifdef WLED_DEBUG
|
|
||||||
Serial.print(F("Getting pin="));
|
|
||||||
Serial.println(_pins[i]);
|
|
||||||
#endif
|
|
||||||
pinArray[i] = _pins[i];
|
pinArray[i] = _pins[i];
|
||||||
}
|
}
|
||||||
return numPins;
|
return numPins;
|
||||||
|
@ -296,34 +296,45 @@ void checkTimers()
|
|||||||
}
|
}
|
||||||
if (sunrise && sunset) daytime = difftime(localTime, sunrise) > 0 && difftime(localTime, sunset) < 0;
|
if (sunrise && sunset) daytime = difftime(localTime, sunrise) > 0 && difftime(localTime, sunset) < 0;
|
||||||
|
|
||||||
|
DEBUG_PRINTF("Local time: %02d:%02d\n", hour(localTime), minute(localTime));
|
||||||
for (uint8_t i = 0; i < 8; i++)
|
for (uint8_t i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
if (timerMacro[i] != 0
|
if (timerMacro[i] != 0
|
||||||
&& (timerHours[i] == hour(localTime) || timerHours[i] == 24) //if hour is set to 24, activate every hour
|
&& (timerHours[i] == hour(localTime) || timerHours[i] == 24) //if hour is set to 24, activate every hour
|
||||||
&& timerMinutes[i] == minute(localTime)
|
&& timerMinutes[i] == minute(localTime)
|
||||||
&& (timerWeekday[i] & 0x01) //timer is enabled
|
&& (timerWeekday[i] & 0x01) //timer is enabled
|
||||||
&& timerWeekday[i] >> weekdayMondayFirst() & 0x01) //timer should activate at current day of week
|
&& ((timerWeekday[i] >> weekdayMondayFirst()) & 0x01)) //timer should activate at current day of week
|
||||||
{
|
{
|
||||||
applyPreset(timerMacro[i]);
|
applyPreset(timerMacro[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sunrise macro
|
// sunrise macro
|
||||||
if (sunrise && timerMacro[8] != 0
|
if (sunrise) {
|
||||||
&& (hour(sunrise) == hour(localTime))
|
time_t tmp = sunrise + timerMinutes[8]*60; // NOTE: may not be ok
|
||||||
&& (minute(sunrise) + timerMinutes[8]) == minute(localTime)
|
DEBUG_PRINTF("Trigger time: %02d:%02d\n", hour(tmp), minute(tmp));
|
||||||
&& (timerWeekday[8] & 0x01) //timer is enabled
|
if (timerMacro[8] != 0
|
||||||
&& timerWeekday[8] >> weekdayMondayFirst() & 0x01) //timer should activate at current day of week
|
&& hour(tmp) == hour(localTime)
|
||||||
{
|
&& minute(tmp) == minute(localTime)
|
||||||
applyPreset(timerMacro[8]);
|
&& (timerWeekday[8] & 0x01) //timer is enabled
|
||||||
|
&& ((timerWeekday[8] >> weekdayMondayFirst()) & 0x01)) //timer should activate at current day of week
|
||||||
|
{
|
||||||
|
applyPreset(timerMacro[8]);
|
||||||
|
DEBUG_PRINTF("Sunrise macro %d triggered.",timerMacro[8]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// sunset macro
|
// sunset macro
|
||||||
if (sunset && timerMacro[9] != 0
|
if (sunset) {
|
||||||
&& (hour(sunrise) == hour(localTime))
|
time_t tmp = sunset + timerMinutes[9]*60; // NOTE: may not be ok
|
||||||
&& (minute(sunrise) + timerMinutes[9]) == minute(localTime)
|
DEBUG_PRINTF("Trigger time: %02d:%02d\n", hour(tmp), minute(tmp));
|
||||||
&& (timerWeekday[9] & 0x01) //timer is enabled
|
if (timerMacro[9] != 0
|
||||||
&& timerWeekday[9] >> weekdayMondayFirst() & 0x01) //timer should activate at current day of week
|
&& hour(tmp) == hour(localTime)
|
||||||
{
|
&& minute(tmp) == minute(localTime)
|
||||||
applyPreset(timerMacro[9]);
|
&& (timerWeekday[9] & 0x01) //timer is enabled
|
||||||
|
&& ((timerWeekday[9] >> weekdayMondayFirst()) & 0x01)) //timer should activate at current day of week
|
||||||
|
{
|
||||||
|
applyPreset(timerMacro[9]);
|
||||||
|
DEBUG_PRINTF("Sunset macro %d triggered.",timerMacro[9]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// version code in format yymmddb (b = daily build)
|
// version code in format yymmddb (b = daily build)
|
||||||
#define VERSION 2103072
|
#define VERSION 2103073
|
||||||
|
|
||||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||||
//#define WLED_USE_MY_CONFIG
|
//#define WLED_USE_MY_CONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user