UM BH1750 adapted to "MM style", 8266 build fixes
* UM BH1750 adjustments to use new MM features * UM BH1750 check sensor status before tryig to read new value (avoids blocking LED updates) * UM temperature: ensure that measurements continue with many LEDs running (strip.isUpdating() will be true all the time) * all usermods: solved compile problems on 8266
This commit is contained in:
@@ -194,7 +194,9 @@ class UsermodTemperature : public Usermod {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (!enabled || !sensorFound || strip.isUpdating()) return;
|
||||
unsigned long last_runtime = 0; // WLEDMM ensure that strip.isUpdating() will not block longer that 4000ms
|
||||
if (!enabled || !sensorFound || (strip.isUpdating() && (millis()-last_runtime < 4000))) return; // WLEDMM be nice, but not too nice
|
||||
last_runtime = millis();
|
||||
|
||||
static uint8_t errorCount = 0;
|
||||
unsigned long now = millis();
|
||||
|
||||
Reference in New Issue
Block a user