Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Multi_WS2811 mbed MMA8451Q
Fork of WS2811 by
Diff: WS2811.h
- Revision:
- 30:52e9205a8059
- Parent:
- 23:33df42ff2541
diff -r a76075c853ee -r 52e9205a8059 WS2811.h
--- a/WS2811.h Fri Jan 03 19:17:24 2014 +0000
+++ b/WS2811.h Sat Jan 04 00:32:16 2014 +0000
@@ -22,6 +22,7 @@
#define MAX_LEDS_PER_STRIP 60
extern "C" void DMA0_IRQHandler();
+extern "C" void TPM0_IRQHandler();
class WS2811 : public LedStrip
{
@@ -33,7 +34,6 @@
virtual void blank();
static void startDMA();
- static bool is_dma_done();
private:
uint32_t pinMask;
@@ -44,7 +44,8 @@
static bool initialized;
static uint32_t enabledPins;
- static Timer guardtime;
+ static volatile bool dma_done;
+ static void wait_for_dma_done() { while (!dma_done) __WFI(); }
static void writeByte(uint8_t byte, uint32_t mask, uint32_t *dest);
@@ -55,7 +56,7 @@
static void tpm_init();
static void dma_data_init();
- friend void DMA0_IRQHandler();
+ friend void TPM0_IRQHandler();
};
#endif

Generic WS2811/WS2812