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:
Frank
2023-05-10 20:14:10 +02:00
parent 3aad3a8ff7
commit 50061ddae8
4 changed files with 30 additions and 24 deletions

View File

@@ -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();