mbed-os github

Dependencies:   ADS1015 Faulhaber HTU21D_mod MS5837_potless Sensor_Head_RevB_3 USBDevice_dfu Utilsdfu beep

Fork of ARNSRS_testDFU by POTLESS

Files at this revision

API Documentation at this revision

Comitter:
POTLESS_2
Date:
Thu Jul 26 05:59:25 2018 +0000
Parent:
79:d22473a0e20d
Child:
81:83567a0ce82c
Commit message:
commande sup vers ihm

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Jul 20 08:03:18 2018 +0000
+++ b/main.cpp	Thu Jul 26 05:59:25 2018 +0000
@@ -162,9 +162,11 @@
 bool flag_Piles = false;
 
 //Commande à envoyer à l'IHM
-//0 -> Marche
-//1 -> Au dodo
+//0 -> Marche normale
+//1 -> Mise en veille
+//2 -> Perte alim
 //3 -> Big problème
+//4 -> Reset
 int Commande_IHM = 0;
 
 //Pin connexion USB et Piles
@@ -195,7 +197,7 @@
 void Save_Pos();//Sauvegarde des positions moteurs
 void Mode_SECU();//Mise en secu des moteurs
 void Sleep_IHM();//Mise en veille IHM, envoie de la consigne sur son port série
-void Sleep_HIGHT_WakeUp();//Mise en veille MCU avec réveille sur front haut
+void Sleep_HIGH_WakeUp();//Mise en veille MCU avec réveille sur front haut
 void Sleep_LOW_WakeUp();//Mise en veille MCU avec réveille sur front bas. BABEFACE
 void ALIM_is_unplugged();//Appelée par l'intéruption. Passe juste un FLAG à false
 void ALIM_unplugged();//Appelée par le sécu THREAD si le FLAG ci-dessus passe a false
@@ -270,7 +272,7 @@
 void Sleep_IHM(int commande)
 {
     //Mise en veille de l'IHM
-    IHM("<0 0 ;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;%d>\r\n", commande);
+    IHM("<0/0/0 0-0-0 ;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;%d>\r\n", commande);
 
     wait(0.5);
 
@@ -283,7 +285,7 @@
 
 }
 
-void Sleep_HIGHT_WakeUp()
+void Sleep_HIGH_WakeUp()
 {
 
     E5V = 0;
@@ -336,7 +338,7 @@
     WRITE_REG( RTC->BKP31R, 0x1 );
 
     //Enter shutdown mode
-    //E3V=0;
+    E3V=0;
     //Enter shutdown mode
     HAL_PWREx_EnterSHUTDOWNMode();
 }
@@ -356,7 +358,7 @@
 
     Mode_SECU();
 
-    Sleep_HIGHT_WakeUp();
+    Sleep_HIGH_WakeUp();
 
 }
 
@@ -364,6 +366,8 @@
 void Stop_Sequence()
 {
     OUTPUT("  Mise en veille de l'appareil.\r\n");
+    
+    buzzer.beep(1000,0.1);
 
     Sleep_IHM(1);
 
@@ -632,11 +636,11 @@
             OUTPUT("  Démarrage du tracé Arduino.\r\n");
         }
     } else if (0 == strcmp(com, "ping")) {
-        /*Commande_IHM = 1;
-        IHM("<0 0 ;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;%d>\r\n", Commande_IHM);
-        FLAG_DISPLAY = false;
-        Commande_IHM = 0;*/
         E3V = 0;
+    } else if (0 == strcmp(com, "res_ihm")) {
+        IHM("<0/0/0 0-0-0 ;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;%d>\r\n", 4);
+    } else if (0 == strcmp(com, "page_ihm")) {
+        IHM("<0/0/0 0-0-0 ;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;%d>\r\n", 5);        
     } else if (0 == strcmp(com, "arnsrs_id")) {
         OUTPUT("  Changement de l'ID de l'appareil pour le N°: %s\r\n", numb);
         //UTILS::Store_A_Val(atoi(numb), "ARNSRS_ID");
@@ -1017,7 +1021,9 @@
     vusb_off_on.fall(&ALIM_is_unplugged);
 
     vpiles_off_on.fall(&ALIM_is_unplugged);
-
+    
+    IHM("<0/0/0 0-0-0 ;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;%d>\r\n", 4);
+    
     buzzer.beep(1000,0.3);
     wait_ms(500);
     buzzer.beep(1000,0.3);