Optimised fork of bikeNomad's WS2811 LED control library. Supports KL25Z and KL46Z
Fork of Multi_WS2811 by
Optimised to use far less RAM than the original.
Capable of running up to 8 strings of 240 LEDs each with plenty of RAM to spare on the KL46Z.
Should run at least three strings of 240 LEDs on the KL25Z (RAM limited)
Diff: WS2811.cpp
- Revision:
- 7:58623ad7f310
- Parent:
- 6:3b5b8a367f40
--- a/WS2811.cpp Wed Apr 02 12:16:42 2014 +0000 +++ b/WS2811.cpp Wed Apr 02 13:22:25 2014 +0000 @@ -212,8 +212,8 @@ NVIC_EnableIRQ(TPM0_IRQn); } -WS2811::WS2811(unsigned n, unsigned pinNumber) - : LedStrip(n) +WS2811::WS2811(uint16_t pixelCount, uint8_t pinNumber) + : LedStrip(pixelCount) , pinMask(1U << pinNumber) { enabledPins |= pinMask; @@ -224,7 +224,7 @@ void WS2811::startDMA() { hw_init(); - + wait_for_dma_done(); dma_done = false; @@ -386,7 +386,7 @@ extern "C" void TPM0_IRQHandler() { TPM0->SC = 0; // disable internal clocking - TPM0->SC = TPM_SC_TOF_MASK; + TPM0->SC = TPM_SC_TOF_MASK; RESET_DEBUG; WS2811::dma_done = true; }