Simple neopixel (WS2812) library, tuned for stm32 (L432) at 80 MHz Should be compatible with any stm32, different clock speed may require timing adjustments in neopixel.c
Dependents: NEOPIXEL_SAMPLE ppd
Revision 1:415459e3f93b, committed 2020-01-02
- Comitter:
- tichise
- Date:
- Thu Jan 02 07:56:44 2020 +0000
- Parent:
- 0:a81364d9a67b
- Commit message:
- Fixed __nop from lowercase to uppercase to work with PlatformIO
Changed in this revision
neopixel.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r a81364d9a67b -r 415459e3f93b neopixel.cpp --- a/neopixel.cpp Tue Mar 21 21:17:08 2017 +0000 +++ b/neopixel.cpp Thu Jan 02 07:56:44 2020 +0000 @@ -16,17 +16,17 @@ // duty cycle determines bit value if (byte & 0x80) { // one - for(int j = 0; j < 6; j++) __nop(); + for(int j = 0; j < 6; j++) __NOP(); gpio_write(&gpio, 0); - for(int j = 0; j < 2; j++) __nop(); + for(int j = 0; j < 2; j++) __NOP(); } else { // zero - for(int j = 0; j < 2; j++) __nop(); + for(int j = 0; j < 2; j++) __NOP(); gpio_write(&gpio, 0); - for(int j = 0; j < 5; j++) __nop(); + for(int j = 0; j < 5; j++) __NOP(); } byte = byte << 1; // shift to next bit