nucleo version

Fork of PololuLedStrip by David Grayson

Files at this revision

API Documentation at this revision

Comitter:
michaeljkoster
Date:
Wed Dec 24 18:15:59 2014 +0000
Parent:
21:87fd6273e0ff
Child:
23:aa89fb2a5769
Commit message:
ST Nucleo F411RE changes and tweaks

Changed in this revision

PololuLedStrip.cpp Show annotated file Show diff for this revision Revisions of this file
PololuLedStrip.h Show annotated file Show diff for this revision Revisions of this file
led_strip_write_color.s Show annotated file Show diff for this revision Revisions of this file
--- a/PololuLedStrip.cpp	Tue Nov 26 23:05:08 2013 +0000
+++ b/PololuLedStrip.cpp	Wed Dec 24 18:15:59 2014 +0000
@@ -1,4 +1,5 @@
 #include "PololuLedStrip.h"
+extern Serial pc;
 
 bool PololuLedStrip::interruptFriendly = false;
 
@@ -25,8 +26,10 @@
         // running; the most likely explanation is some kind of flash caching that affects the timing.
         // If you ever change these numbers, it is important to check the the subtractions below
         // will not overflow in the worst case (smallest possible f_mhz).
-        led_strip_write_delays[0] = 750*f_mhz/1000 - 33;
-        led_strip_write_delays[1] = 550*f_mhz/1000 - 20;    
+        //led_strip_write_delays[0] = 750*f_mhz/1000 - 33;
+        //led_strip_write_delays[1] = 550*f_mhz/1000 - 20;    
+        led_strip_write_delays[0] = 28; // for Nucleo F411RE
+        led_strip_write_delays[1] = 20;    
     }
  
     // Convert from units of cycles to units of half-cycles; it makes the assembly faster.   
@@ -38,7 +41,8 @@
 
 PololuLedStrip::PololuLedStrip(PinName pinName)
 {
-    gpio_init(&gpio, pinName, PIN_OUTPUT);
+//    gpio_init(&gpio, pinName, PIN_OUTPUT);
+    gpio_init_out(&gpio, pinName); // for Nucleo F411RE
 }
 
 void PololuLedStrip::write(rgb_color * colors, unsigned int count)
--- a/PololuLedStrip.h	Tue Nov 26 23:05:08 2013 +0000
+++ b/PololuLedStrip.h	Wed Dec 24 18:15:59 2014 +0000
@@ -17,7 +17,8 @@
     } rgb_color;
     #endif
 
-    extern "C" int led_strip_write_color(rgb_color *, volatile uint32_t * set, volatile uint32_t * clear, uint32_t mask);
+//    extern "C" int led_strip_write_color(rgb_color *, volatile uint32_t * set, volatile uint32_t * clear, uint32_t mask);
+    extern "C" int led_strip_write_color(rgb_color *, volatile uint16_t * set, volatile uint16_t * clear, uint32_t mask);
 
     /** This class lets you control the addressable RGB LED strips from Pololu</a>,
     or any other LED strip based on the TM1804 chip. */
--- a/led_strip_write_color.s	Tue Nov 26 23:05:08 2013 +0000
+++ b/led_strip_write_color.s	Wed Dec 24 18:15:59 2014 +0000
@@ -56,6 +56,38 @@
     nop
     nop
     nop
+
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    nop
+    
     
     ldr r4, =0x80000000
     tst r6, r4