From df325ab11d171a0ca89cb6450ec67d6a832a6dad Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 24 Apr 2024 08:06:54 -0700 Subject: [PATCH] cleanuo --- src/internal/methods/PixieStreamMethod.h | 5 +++++ src/internal/methods/Tlc5947GenericMethod.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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);