Index: branch/mbaye/Emb_App.tws
===================================================================
--- branch/mbaye/Emb_App.tws	(revision 535)
+++ branch/mbaye/Emb_App.tws	(revision 536)
@@ -11,8 +11,10 @@
 "E:\tp_info6_2018_mbaye\tp_info6\bsp\uart0.c" 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\Debug\mr308.inc" 150 150 1430 351 0 6 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 0 474 160 38 0 1 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" -8 -30 1596 539 1 3 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 2 
Index: branch/mbaye/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/mbaye/Emb_App/SessionM32C_E8a_system.ini	(revision 535)
+++ branch/mbaye/Emb_App/SessionM32C_E8a_system.ini	(revision 536)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0044
+RESET=ff008a
Index: branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf	(revision 535)
+++ branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf	(revision 536)
@@ -149,12 +149,12 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_13" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_14" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000512" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0570" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF05B0" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000001852" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000882" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "000000000000174A" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000884" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000001" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000044" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004044" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_21" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_22" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_23" "0000000000000000" 
@@ -173,7 +173,7 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "000000000000000B" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000187E" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000001780" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000512" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
@@ -217,7 +217,9 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "feu, 1, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "6" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006" "tour, 10, 0, P, Col, Hex, N" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "7" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -321,6 +323,7 @@
 [WINDOW_Z_ORDER]
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_mbaye\tp_info6\bsp\uart0.c" 
 "E:\tp_info6_2018_mbaye\tp_info6\bsp\can.c" 
@@ -371,5 +374,5 @@
 [FLASH_DETAILS]
 "" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
 [BREAKPOINTS]
-"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 90910464 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 90242312 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/mbaye/Emb_App/programme_principal_etud.c
===================================================================
--- branch/mbaye/Emb_App/programme_principal_etud.c	(revision 535)
+++ branch/mbaye/Emb_App/programme_principal_etud.c	(revision 536)
@@ -129,7 +129,7 @@
 int info_piste;
 int numero_p;
 int feu;
-//int tour=1;
+int tour=1;
 int consigne =450;
 
 void asserv_T()
@@ -262,18 +262,26 @@
 	{
 	  CanFrame commv;
 	  commv.data.id='V'; commv.data.rtr=0; 
-      dly_tsk(3000);
-	  //if(capt==0x5602) tour=tour+1;
 	  if(Bp_G==1)
 	  {
 		  commv.data.val=0;
 	      snd_dtq (CanTx,commv.msg);
+		  LED_R=!LED_R;
 	  }
-	  /*if(tour==4)
+	  if(Bp_M==1)
 	  {
+		  commv.data.val=ad00+ad01;
+	      snd_dtq (CanTx,commv.msg);
+		  LED_R=!LED_R;
+	  }
+	  if(tour==4)
+	  {
 		  commv.data.val=0;
 	      snd_dtq (CanTx,commv.msg);
-	  }*/
+	  }
+      dly_tsk(3000);
+	  
+
 	  switch (numero_p)
 	  {
 	    //else if(numero_p==0x0001)
@@ -320,7 +328,7 @@
 		  }
 		  else if(capt==0x4a01)
 		  {
-	        commv.data.val=10;
+	        commv.data.val=22;
 	        snd_dtq (CanTx,commv.msg);
 		  }
 			
@@ -329,10 +337,14 @@
 	        commv.data.val=20;
 	        snd_dtq (CanTx,commv.msg);
 		  }
-		  
+		  else if(capt==0x5604)
+		  {
+	        commv.data.val=30;
+	        snd_dtq (CanTx,commv.msg);
+		  }
 		  else
 		  {
-		    commv.data.val=15;
+		    commv.data.val=20;
 	        snd_dtq (CanTx,commv.msg);	
 		  }
 		  break;
@@ -391,7 +403,12 @@
 	   snd_dtq (CanTx,req.msg);
 	   wai_flg(ev_periph, 0x01, TWF_ANDW, &flag);
        capt = periph[ADDR('C')].val;
-	   dly_tsk(50);
+	   dly_tsk(30);
+	   if(capt==0x5602)
+	   {
+		    tour=tour+1;
+			dly_tsk(30);
+	   }
 	}
 }
 void mode_course()
@@ -431,38 +448,22 @@
         return puiss;        
 }
 unsigned int decode_int(char *chaine){
- unsigned int  nombre=0;
- int entier[10]={0};
- int i=0,j = 0, n = 0;
- if(chaine[i] != '#') return -1;
- i=1;
+unsigned int  nombre=0;
+int entier[10]={0};
+int i=0,j = 0, n = 0;
+if(chaine[i] != '#') return -1;
+i=1;
   while(chaine[i] != '*')
     {                
-                if('0'>chaine[i] && chaine[i]>'9') return -1;
-                entier[i-1] = chaine[i] - '0';
-                i++;
-        }
-        for(j=0;j<i-1;j++)
-        {
-         nombre = nombre + entier[j]*Puiss10(i-2-j);        
-        }
-        return nombre;
-   
- /*if(chaine[i]='#'){
-  
-  i++;
-  c=chaine[i];
-  while(c!='*'){ 
-   if(c<=57 && c>=48){
-    nombre=(nombre*10)+(c-48);     
-   }
-   i++;
-   return nombre;
-  }  
- }
- else{
-  return -1;
- }*/
+        if('0'>chaine[i] && chaine[i]>'9') return -1;
+        entier[i-1] = chaine[i] - '0';
+        i++;
+    }
+   for(j=0;j<i-1;j++)
+    {
+        nombre = nombre + entier[j]*Puiss10(i-2-j);        
+    }
+    return nombre;
 }
 void clavier() 
 {
@@ -471,25 +472,28 @@
  int index = 1;
  while(1) 
  {
-          vrcv_dtq(QdmTouche, &code_touche);
-            lcd_putc(code_touche);
-                while(code_touche != '*')
-                {                
-                   if(code_touche == '#')
-                    {
-                      sequence[0] = code_touche; 
-                    } 
-                    else
-                    {
-                     sequence[index] = code_touche;
-                        index++;
-                     }
-                     vrcv_dtq(QdmTouche, &code_touche);
-                     lcd_putc(code_touche);
-                 }
-        sequence[index] = '*';
-        //consigne = decode_int(sequence);
-        index=1;
+     vrcv_dtq(QdmTouche, &code_touche);
+     lcd_putc(code_touche);
+     while(code_touche != '*')
+     {                
+       if(code_touche == '#')
+         {
+            sequence[0] = code_touche; 
+         } 
+       else
+         {
+           sequence[index] = code_touche;
+           index++;
+         }
+       vrcv_dtq(QdmTouche, &code_touche);
+       lcd_putc(code_touche);
+      }
+	 //lcd_com(0xC0);
+      sequence[index] = '*';
+      consigne = decode_int(sequence);
+      index=1;
+		
+		
  }
  dly_tsk(60);
 		
@@ -518,7 +522,15 @@
 	sta_tsk(ID_mode_course);
 	sta_tsk(ID_clavier);
 	
-	switch (numero_p){
+	
+	
+	
+
+    while(1)
+    {
+		
+	  lcd_com(0x80);
+		switch (numero_p){
 			case 0x0001:
 			lcd_str("Piste Verte");
 			break;
@@ -532,11 +544,27 @@
 			lcd_str("Piste Noire");
 			break;
 		}
-		 dly_tsk(50);
-
-    while(1)
-    {
-	   dly_tsk(1000); 
+		 dly_tsk(50);
+		 lcd_com(0xC0);
+		 switch (capt){
+			case 0x5601:
+			lcd_str("Capteur vert");
+			break;
+			case 0x4a01:
+			lcd_str("Capteur Jaune");
+			break;
+			case 0x5202:
+			lcd_str("Capteur Rouge");
+			break;
+			case 0x4203:
+			lcd_str("Capteur Bleu");
+			break;
+			case 0x4304:
+			lcd_str("Capteur Cyan");
+			break;
+			dly_tsk(20);
+		 }
+	  
     }
 		
 }
Index: branch/mbaye/Emb_App/conf_noyau.cfg
===================================================================
--- branch/mbaye/Emb_App/conf_noyau.cfg	(revision 535)
+++ branch/mbaye/Emb_App/conf_noyau.cfg	(revision 536)
@@ -20,7 +20,7 @@
 
 // max definition
 maxdefine{
-	max_task	= 10;
+	max_task	= 11;
 	max_flag	= 3;
 	max_dtq	= 2;
 	max_cyh	= 1;
@@ -70,6 +70,7 @@
 	initial_start	= ON;
 	exinf	= 0x0;
 };
+
 task[]{
 	entry_address	= info_capt();
 	name	= ID_info_capt;
Index: branch/mbaye/Emb_App/EmbM32C87App.tps
===================================================================
--- branch/mbaye/Emb_App/EmbM32C87App.tps	(revision 535)
+++ branch/mbaye/Emb_App/EmbM32C87App.tps	(revision 536)
@@ -18,7 +18,7 @@
 "SessionM32C_E8a_system" 
 [GENERAL_DATA_PROJECT]
 [GENERAL_DATA_CONFIGURATION_Debug]
-"PROJECT_FILES_MODIFIED_DATA_TAG" "FALSE" 
+"PROJECT_FILES_MODIFIED_DATA_TAG" "TRUE" 
 [SESSIONS_Debug]
 "DefaultSession" 
 "SessionM32C_E8a_system" 
