Version avec sortie ABCD sur même connecteur

Dependencies:   SDFileSystemDMA mbed

Fork of DmdFullRGB_0_1 by Christophe Girardot

Revision:
1:353c1902483f
Parent:
0:d5f38b9d7c7a
Child:
2:2f5b7e5faf83
--- a/main.cpp	Sat Dec 02 12:27:01 2017 +0000
+++ b/main.cpp	Sun Dec 03 17:24:56 2017 +0000
@@ -12,29 +12,99 @@
 #include "mbed.h"
 
 /* Include des librairies */
+#include "configuration.h"
 #include "SDFileSystemDMA.h"
 #include "spi_device.h"
 #include "Scrolling.h"
 #include "Animation.h"
+#include "Font.h"
 #include "Clock.h"
-#include "Font.h"
 #include "Dmd.h"
 #include "SD.h"
 
 /* Programme principal */
 int main() 
 {
+    for(unsigned char ligne =0; ligne < 8; ligne++)
+    {
+        unsigned char bit = 0;
+        while(bit<16) {
+            Display_Ram[(128*ligne)+bit] = 0;
+            bit++;
+        }
+        for(unsigned char shade = 2; shade<9; shade++) {
+            while(bit<(16*shade)) {
+                Display_Ram[(128*ligne)+bit] = Red_Mask[shade-2];
+                bit++;
+            }
+        }
+    }
+    for(unsigned char ligne =0; ligne < 8; ligne++)
+    {
+        unsigned char bit = 0;
+        while(bit<16) {
+            Display_Ram[(128*ligne)+bit] = 0;
+            bit++;
+        }
+        for(unsigned char shade = 2; shade<9; shade++) {
+            while(bit<(16*shade)) {
+                Display_Ram[(128*ligne)+bit] = Red_Mask[shade-2];
+                bit++;
+            }
+        }
+    }
+    for(unsigned char ligne =0; ligne < 8; ligne++)
+    {
+        unsigned char bit = 0;
+        while(bit<16) {
+            Display_Ram[1024+(128*ligne)+bit] = 0;
+            bit++;
+        }
+        for(unsigned char shade = 2; shade<9; shade++) {
+            while(bit<(16*shade)) {
+                Display_Ram[1024+(128*ligne)+bit] = Green_Mask[shade-2];
+                bit++;
+            }
+        }
+    }
+    for(unsigned char ligne =0; ligne < 8; ligne++)
+    {
+        unsigned char bit = 0;
+        while(bit<16) {
+            Display_Ram[2048+(128*ligne)+bit] = 0;
+            bit++;
+        }
+        for(unsigned char shade = 2; shade<9; shade++) {
+            while(bit<(16*shade)) {
+                Display_Ram[2048+(128*ligne)+bit] = Blue_Mask[shade-2];
+                bit++;
+            }
+        }
+    }
+    for(unsigned char ligne =0; ligne < 8; ligne++)
+    {
+        unsigned char bit = 0;
+        while(bit<16) {
+            Display_Ram[3072+(128*ligne)+bit] = 0;
+            bit++;
+        }
+        for(unsigned char shade = 2; shade<9; shade++) {
+            while(bit<(16*shade)) {
+                Display_Ram[3072+(128*ligne)+bit] = Red_Mask[shade-2] | Green_Mask[shade-2] | Blue_Mask[shade-2];
+                bit++;
+            }
+        }
+    }
+    
+    // Message de re-démarrage
     pc.printf("\n\n\n\n\n\n** REBOOT **\n\n\n\n\n");
     
     // Fonction de mise à l'heure, il faut démarrer la carte avec le doigt sur le bouton pour y acceder 
-    if (mybutton == 1) 
+    if (mybutton == 1)
     {
-        Read_Timestamp();                       // Lecture du fichier timestamp sur la carte SD
-        time_t time_update = Actual_timestamp;
-        set_time(time_update);                  // Mise à jour de l'heure
-        printf("L'heure a ete mise a jour.\n"); // Envoyer une commande confirmation sur le port de communication
-        printf("=> %s",ctime(&time_update));    // Afficher la date et l'heure entrée dans la RTC
-        while(mybutton == 1);                   // attendre que le bouton soit relaché
+        Set_Clock();
+        while(mybutton == 1)
+            refresh();
     }
     
     Intro                   ();      // Afficher l'intro pendant 5 secondes en rouge
@@ -44,6 +114,6 @@
     {         
         Read_Next_Command(); // Effectuer la prochaine commande  
         if (mybutton == 1) 
-            Scrolling(128,Pussy); // Image cachée si l'utilisateur appuis sur le bouton à ce moment précis
+            Scrolling(128,Pussy); // Image cachée si l'utilisateur appuis sur le bouton à ce moment
     }
 }
\ No newline at end of file