diff --git a/src/internal/methods/PixieStreamMethod.h b/src/internal/methods/PixieStreamMethod.h index e1d7ddb..6836b86 100644 --- a/src/internal/methods/PixieStreamMethod.h +++ b/src/internal/methods/PixieStreamMethod.h @@ -72,8 +72,13 @@ public: { while (!IsReadyToUpdate()) { +#if !defined(NEOPIXEBUS_NO_YIELD) + yield(); // allows for system yield if needed +#endif } + _stream->write(_data, _sizeData); + _usEndTime = micros(); // Save time to ensure 1ms delay } diff --git a/src/internal/methods/Tlc5947GenericMethod.h b/src/internal/methods/Tlc5947GenericMethod.h index 001b388..1274188 100644 --- a/src/internal/methods/Tlc5947GenericMethod.h +++ b/src/internal/methods/Tlc5947GenericMethod.h @@ -142,10 +142,9 @@ public: void Update(bool) { - digitalWrite(_pinOutputEnable, HIGH); - digitalWrite(_pinLatch, LOW); + _wire.beginTransaction(); // We need to write the channels in reverse order. Get a Pointer to the last channel. @@ -159,6 +158,7 @@ public: } _wire.endTransaction(); + digitalWrite(_pinLatch, HIGH); digitalWrite(_pinLatch, LOW); digitalWrite(_pinOutputEnable, LOW);