Fun LED stuff

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Files at this revision

API Documentation at this revision

Comitter:
kkleong
Date:
Mon Nov 16 15:02:45 2020 +0000
Parent:
3:d050fe8ebd78
Commit message:
Newe redBlue

Changed in this revision

Program3_F20_Leong.s Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Program3_F20_Leong.s	Mon Nov 16 06:35:09 2020 +0000
+++ b/Program3_F20_Leong.s	Mon Nov 16 15:02:45 2020 +0000
@@ -10,28 +10,18 @@
                     
                     GLOBAL swapRedBlue
                     ; uint32_t swapRedBlue ( uint32_t color)
-swapRedBlue         MOV R1, R0
-                    MOV R2, R0
-                    MOV R3, R0
-                    MOV R4, R0
-                    
-                    LSL R1, R1, #24
-                    LSR R1, R1, #8
-                    
-                    LSL R2, R2, #8
-                    LSR R2, R2, #24
+swapRedBlue         AND R1, R0, #0x00FF0000
+                    ASR R1, R1, #16
                     
-                    LSR R3, R3, #24
-                    LSL R3, R3, #24
+                    LDR R5, =0x000000FF
+                    AND R2, R0, R5
+                    LSL R2, R2, #16
                     
-                    LSL R4, R4, #16
-                    LSR R4, R4, #24
-                    LSL R4, R4, #8
+                    LDR R4, =0xFF00FF00
+                    AND R3, R0, R4
                     
-                    ORR R5, R1, R2
-                    ORR R6, R3, R4
-                    ORR R0, R5, R6
-                    BX LR
+                    ORR R0, R1, R2
+                    ORR R0, R0, R3
                     
                     GLOBAL toggleAlphaMSB
                     ; uint32_t toggleAlphaMSB ( uint32_t color)
--- a/main.cpp	Mon Nov 16 06:35:09 2020 +0000
+++ b/main.cpp	Mon Nov 16 15:02:45 2020 +0000
@@ -111,7 +111,7 @@
             lcd.DrawRect(xSize, 0, xSize, ySize);
             lcd.FillRect(xSize, 0, xSize, ySize);
         }
-        else if(quad == 3){
+        else if(quad == 4){
             sprintf((char*)text, "QUAD:  %d", quad);
             lcd.DisplayStringAt(8, LINE(5), (uint8_t *)&text, CENTER_MODE);
             
@@ -120,14 +120,14 @@
             lcd.DrawRect(xSize, ySize, xSize, ySize);
             lcd.FillRect(xSize, ySize, xSize, ySize);
         }
-        else if(quad == 4){
+        else if(quad == 3){
             sprintf((char*)text, "QUAD:  %d", quad);
             lcd.DisplayStringAt(8, LINE(5), (uint8_t *)&text, CENTER_MODE);
             
             green = setRGBBits(green, 2); 
             lcd.SetTextColor(green);
-            lcd.DrawRect(xSize, ySize, xSize, ySize);
-            lcd.FillRect(xSize, ySize, xSize, ySize);
+            lcd.DrawRect(0, ySize, xSize, ySize);
+            lcd.FillRect(0, ySize, xSize, ySize);
         }
         wait(.2);
     }