modify for w7500

Fork of WS2812 by Brian Daniels

Files at this revision

API Documentation at this revision

Comitter:
jcm931213
Date:
Mon Nov 27 11:49:38 2017 +0000
Parent:
2:6e647820f587
Commit message:
modified for w7500

Changed in this revision

WS2812.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6e647820f587 -r 33b71af3ca0d WS2812.cpp
--- a/WS2812.cpp	Thu Feb 12 20:24:15 2015 +0000
+++ b/WS2812.cpp	Mon Nov 27 11:49:38 2017 +0000
@@ -49,7 +49,9 @@
     
         // set the intensity scaling factor (global, per pixel, none)
         if (__use_II == GLOBAL) {
+            
             sf = __II;
+            //printf("use globarl : %d\r\n", sf);
         } else if (__use_II == PER_PIXEL) {
             sf = agrb[3];
         } else {
@@ -90,23 +92,28 @@
     for (i = 0; i < FRAME_SIZE * __size; i++) {
         j = 0;
         if (__transmitBuf[i]){
-            __gpo = 1;
-            for (; j < __oneHigh; j++) {
-                __nop();
-            }
-            __gpo = 0;
-            for (; j < __oneLow; j++) {
-                __nop();
-            }
+            *(volatile uint32_t *)(0x44000000) = 0x0000002;
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");            
+            asm("nop");
+            asm("nop");
+            *(volatile uint32_t *)(0x44000000) = 0x0000000;
         } else {
-            __gpo = 1;
-            for (; j < __zeroHigh; j++) {
-                __nop();
-            }
-            __gpo = 0;
-            for (; j < __zeroLow; j++) {
-                __nop();
-            }
+            *(volatile uint32_t *)(0x44000000) = 0x0000002;
+
+            *(volatile uint32_t *)(0x44000000) = 0x0000000;
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");
+            asm("nop");
         }
     }