This commit is contained in:
Michael Miller
2024-04-24 08:06:54 -07:00
parent eeff56ae87
commit df325ab11d
2 changed files with 7 additions and 2 deletions

View File

@@ -72,8 +72,13 @@ public:
{ {
while (!IsReadyToUpdate()) while (!IsReadyToUpdate())
{ {
#if !defined(NEOPIXEBUS_NO_YIELD)
yield(); // allows for system yield if needed
#endif
} }
_stream->write(_data, _sizeData); _stream->write(_data, _sizeData);
_usEndTime = micros(); // Save time to ensure 1ms delay _usEndTime = micros(); // Save time to ensure 1ms delay
} }

View File

@@ -142,10 +142,9 @@ public:
void Update(bool) void Update(bool)
{ {
digitalWrite(_pinOutputEnable, HIGH); digitalWrite(_pinOutputEnable, HIGH);
digitalWrite(_pinLatch, LOW); digitalWrite(_pinLatch, LOW);
_wire.beginTransaction(); _wire.beginTransaction();
// We need to write the channels in reverse order. Get a Pointer to the last channel. // We need to write the channels in reverse order. Get a Pointer to the last channel.
@@ -159,6 +158,7 @@ public:
} }
_wire.endTransaction(); _wire.endTransaction();
digitalWrite(_pinLatch, HIGH); digitalWrite(_pinLatch, HIGH);
digitalWrite(_pinLatch, LOW); digitalWrite(_pinLatch, LOW);
digitalWrite(_pinOutputEnable, LOW); digitalWrite(_pinOutputEnable, LOW);