Update WS2812 driver

Update WS2812 driver for new state time
This commit is contained in:
Theo Arends 2018-08-26 17:32:49 +02:00
parent bbd2529914
commit ea43540b43
2 changed files with 1 additions and 7 deletions

View File

@ -112,14 +112,11 @@ byte dual_hex_code = 0; // Sonoff dual input flag
uint16_t dual_button_code = 0; // Sonoff dual received code
int16_t save_data_counter; // Counter and flag for config save to Flash
uint8_t fallback_topic_flag = 0; // Use Topic or FallbackTopic
unsigned long state_second = 0; // State second timer
unsigned long state_50msecond = 0; // State 50msecond timer
unsigned long state_100msecond = 0; // State 100msecond timer
unsigned long state_250msecond = 0; // State 250msecond timer
int state = 0; // State 50msecond per second flag (Legacy)
uint8_t state_250mS = 0; // State 250msecond per second flag
int ota_state_flag = 0; // OTA state flag
int ota_result = 0; // OTA result
byte ota_retry_counter = OTA_ATTEMPTS; // OTA retry counter
@ -1857,9 +1854,6 @@ void Every50mSeconds()
{
// As the max amount of sleep = 250 mSec this loop will shift in time...
state++;
if (STATES == state) { state = 0; }
ButtonHandler();
SwitchHandler(0);
}

View File

@ -409,7 +409,7 @@ void Ws2812ShowScheme(uint8_t scheme)
{
switch (scheme) {
case 0: // Clock
if (((STATES/10)*2 == state) || (ws_show_next)) {
if ((1 == state_250mS) || (ws_show_next)) {
Ws2812Clock();
ws_show_next = 0;
}