From 817d0af598d887c7105e7d023f840d4f23762d87 Mon Sep 17 00:00:00 2001 From: Colin Kuebler Date: Fri, 1 Feb 2019 17:37:37 -0500 Subject: [PATCH] No need (and pointless) to call SM16716_Init until color updates, iff using sel pin --- sonoff/xdrv_04_light.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sonoff/xdrv_04_light.ino b/sonoff/xdrv_04_light.ino index ba12ac3db..f65dd43da 100644 --- a/sonoff/xdrv_04_light.ino +++ b/sonoff/xdrv_04_light.ino @@ -535,9 +535,11 @@ void LightInit(void) if (sm16716_pin_sel < 99) { pinMode(sm16716_pin_sel, OUTPUT); digitalWrite(sm16716_pin_sel, LOW); + // no need to call SM16716_Init here, it will be called after sel goes HIGH + } else { + // no sel pin means you have an 'always on' chip, so init right away + SM16716_Init(); } - - SM16716_Init(); } #endif // ifdef USE_SM16716 else {