Suppress Task Switch during show (#186)

This commit is contained in:
Michael Miller
2017-10-21 21:45:14 -07:00
committed by GitHub
parent c42fc3b2f5
commit 6e77d49ff1

View File

@@ -116,11 +116,23 @@ public:
yield(); // allows for system yield if needed
}
noInterrupts(); // Need 100% focus on instruction timing
// Need 100% focus on instruction timing
#if defined(ARDUINO_ARCH_ESP32)
delay(1); // required
portMUX_TYPE updateMux = portMUX_INITIALIZER_UNLOCKED;
taskENTER_CRITICAL(&updateMux);
#else
noInterrupts();
#endif
T_SPEED::send_pixels(_pixels, _pixels + _sizePixels, _pin);
#if defined(ARDUINO_ARCH_ESP32)
taskEXIT_CRITICAL(&updateMux);
#else
interrupts();
#endif
// save EOD time for latch on next call
_endTime = micros();