This library lets you control the addressable RGB LED strips from Pololu Robotics. Forked to add selectable colour order (Support RGB or GRB Leds)
Fork of PololuLedStrip by
Diff: led_strip_write_color.s
- Revision:
- 4:d3b60bd43811
- Parent:
- 0:06475317f283
- Child:
- 5:690fdfb595de
--- a/led_strip_write_color.s Wed Feb 27 02:45:31 2013 +0000 +++ b/led_strip_write_color.s Thu Feb 28 00:42:44 2013 +0000 @@ -2,7 +2,7 @@ EXPORT led_strip_write_color led_strip_write_color - push {r12, r7} + push {r4, r12, r7} ldr r12, [r0] ; Read the next color. rbit r12, r12 ; Reverse the order of the bits. @@ -156,9 +156,21 @@ it cs ; If the bit to send is 1... strcs r3, [r2] ; Drive the line low. - nop - nop - nop + ldr r4, =delay_region + add r4, r4, 34*2 + blx r4 + + sub r7, r7, #1 ; Decrement the loop counter. + cbz r7, led_strip_asm_end ; If we have sent 24 bits, go to the end. + b send_led_strip_bit ; Otherwise, go back and send another bit. + +led_strip_asm_end + pop {r4, r12, r7} + bx lr + + +delay_region + ; The following is 128 no-ops nop nop nop @@ -166,18 +178,16 @@ nop nop nop - - nop - nop - nop - nop nop nop nop nop nop nop - + nop + nop + nop + nop nop nop @@ -188,18 +198,19 @@ nop nop nop - nop nop nop nop nop nop + nop nop nop nop - + nop + nop nop nop nop @@ -221,6 +232,12 @@ nop nop nop + nop + nop + nop + nop + nop + nop nop nop @@ -232,6 +249,12 @@ nop nop nop + nop + nop + nop + nop + nop + nop nop nop @@ -243,17 +266,12 @@ nop nop nop - nop nop nop nop nop nop - nop - nop - nop - nop nop nop @@ -265,21 +283,29 @@ nop nop nop - + nop + nop + nop + nop + nop + nop + nop nop nop nop nop nop - nop - - sub r7, r7, #1 ; Decrement the loop counter. - cbz r7, led_strip_asm_end ; If we have sent 24 bits, go to the end. - b send_led_strip_bit ; Otherwise, go back and send another bit. - -led_strip_asm_end - pop {r12, r7} - bx lr + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + bx lr ; return END \ No newline at end of file