Index: branch/Styves_POUOTONG/tp_info6/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/Styves_POUOTONG/tp_info6/Emb_App/SessionM32C_E8a_system.ini	(revision 495)
+++ branch/Styves_POUOTONG/tp_info6/Emb_App/SessionM32C_E8a_system.ini	(revision 496)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0018
+RESET=ff003a
Index: branch/Styves_POUOTONG/tp_info6/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/Styves_POUOTONG/tp_info6/Emb_App/SessionM32C_E8a_system.hsf	(revision 495)
+++ branch/Styves_POUOTONG/tp_info6/Emb_App/SessionM32C_E8a_system.hsf	(revision 496)
@@ -141,7 +141,7 @@
 "{55384715-F881-421C-A548-D7D1ABE158E1}PDMRWndInstanceKey0" "{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_DENORMAL_MODE" "0" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_EVAL_ROUND_MODE" "0" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000004044" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000020" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_10" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_11" "0000000000000000" 
@@ -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" "0000000000FF05A7" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0592" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000B28" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000084A" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000001" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004005" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000E4E" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000874" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000019" 
+"{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" 
@@ -164,7 +164,7 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_27" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_28" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_29" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_30" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_31" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_32" "0000000000000000" 
@@ -171,9 +171,9 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_33" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "000000000000036A" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000008" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000B5C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000E70" 
 "{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" 
@@ -213,11 +213,13 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Current Scope," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "val_capteur, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "cons_vitesse, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "etat_feu, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "etat_feu, 1, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "cons_vitesse, 1, 0, P, Col, Dec, 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" "tps, 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" 
@@ -288,7 +290,7 @@
 [WINDOW_POSITION_STATE_DATA_VD1]
 "Help" "TOOLBAR 0" 59419 2 4 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
 "{WK_00000001_CmdLine}" "WINDOW" 59422 0 2 "0.07" 365 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0" 
-"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 -4 -30 948 486 9 0 "" "0.0" 
+"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 25 25 1430 351 10 0 "" "0.0" 
 "{WK_00000001_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.03" 365 0 0 350 200 18 0 "32774|32775|32777|<<separator>>|32780|<<separator>>" "0.0" 
 "{WK_00000001_MEMORY}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.23" 365 2 -1 350 200 2065 0 "42202|42203|42204|42233|<<separator>>|42206|42205|42230|42229|42207|<<separator>>|42208|42209|42210|49076|42228|42227|<<separator>>|42231|42232|42234|42235|<<separator>>|42211|<<separator>>|32796|32797" "0.0" 
 "{WK_00000001_OUTPUT}" "WINDOW" 59422 0 3 "0.61" 365 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
@@ -321,12 +323,13 @@
 [WINDOW_Z_ORDER]
 "E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\crt0mr.a30" 
+"E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_Styves_POUOTONG\tp_info6\bsp\uart0.c" 
-"E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\conf_noyau.cfg" 
+"E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\Debug\sys_rom.inc" 
 "E:\tp_info6_2018_Styves_POUOTONG\tp_info6\bsp\periph.c" 
-"E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\conf_noyau.cfg" 
+"E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\Debug\Disassembly" 
 "E:\tp_info6_2018_Styves_POUOTONG\tp_info6\bsp\periph.h" 
-"E:\tp_info6_2018_Styves_POUOTONG\tp_info6\Emb_App\Debug\sys_rom.inc" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -373,5 +376,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 91223040 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 89965776 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/Styves_POUOTONG/tp_info6/Emb_App/programme_principal_etud.c
===================================================================
--- branch/Styves_POUOTONG/tp_info6/Emb_App/programme_principal_etud.c	(revision 495)
+++ branch/Styves_POUOTONG/tp_info6/Emb_App/programme_principal_etud.c	(revision 496)
@@ -150,7 +150,7 @@
 		comm.data.rtr = 0;		//Indique une ecriture
 		comm.data.val = cmd;
 		snd_dtq(CanTx, comm.msg);
-		dly_tsk(10);
+		dly_tsk(50);
 		}
 	}
 void vitesse()
@@ -158,16 +158,25 @@
         CanFrame requete; 
        requete.data.id = 'V';
        requete.data.rtr = 0;
-	if (etat_feu == 0x8000){
-		requete.data.val=25;
-        snd_dtq(CanTx,requete.msg);
-	}
+	 	if (etat_feu == 0x8000)
+		{
+			requete.data.val=25;
+        	snd_dtq(CanTx,requete.msg);
+	 	}
 	 while(1)
-	{
-		switch (num_piste)
+	{	
+		if (Bp_G == 1)
 		{
+			requete.data.val=0;
+             snd_dtq(CanTx,requete.msg);
+			 LED_R=1;
+			}
+		else{
+			LED_R=0;
+			switch (num_piste) 
+			{
 			case 0x0001:
-				cons_vitesse=25;
+				cons_vitesse=40;
 				requete.data.val=cons_vitesse;
             	snd_dtq(CanTx,requete.msg);
 			break;
@@ -195,16 +204,10 @@
                 snd_dtq(CanTx,requete.msg);
 			}
 			break;
-			
-			case 0x0004:
-				cons_vitesse=25;
-				requete.data.val=cons_vitesse;
-            	snd_dtq(CanTx,requete.msg);
-			break;
+			}
 		}
-		
 	}
-               dly_tsk(10); 
+               dly_tsk(50); 
 }
 
 void Asserv1()                        //asservissemt des roues
@@ -246,24 +249,19 @@
 			break;
 
 			case 0x0003:
-			if(dist < 1500 || val_capteur == 0xD8 || val_capteur == 0xD4){
+			if(dist < 1500 || val_capteur == 0xD4){
 				comm.data.val = cmd;
              	snd_dtq(CanTx, comm.msg);
 			}
-			else if (val_capteur == 0x74){
+			else if (val_capteur == 0x74 || val_capteur == 0xD8){
 				comm.data.val = 0;
          		snd_dtq(CanTx, comm.msg);
 			}
 			break;
-			
-			case 0x0004:
-				comm.data.val = cmd;
-                snd_dtq(CanTx, comm.msg);
-			break;
 		}
 			
 	}
-		dly_tsk(10);
+		dly_tsk(50);
 }
     	
 void capteur()
@@ -283,10 +281,9 @@
 		couleur_capteur = capt & 0xFF00;
 		val_capteur = capt & 0x00FF;
 	}
-	dly_tsk(10);	
+	dly_tsk(50);	
 }
 
-
 void mode_course()
 {
         CanFrame req;
@@ -304,8 +301,26 @@
                 etat_feu = mode & 0x8000;
                 num_piste = mode & 0x00FF;
         }
-        dly_tsk(10);        
+        dly_tsk(50);        
 }
+
+void aff_lcd()
+{
+	switch (num_piste){
+		case 0x0001: 
+		lcd_str("Piste verte");
+	    break;
+
+		case 0x0002: 
+		lcd_str("Piste bleu");
+		break;
+
+		case 0x0003: 
+		lcd_str("Piste rouge");
+        break;
+	}	
+	 dly_tsk(50);
+}
 
 void main()
 {
@@ -326,8 +341,9 @@
 	sta_tsk(ID_Asserv0);
 	dly_tsk(2000);
 	sta_tsk(ID_vitesse);
+	sta_tsk(ID_Asserv1);
 	sta_tsk(ID_capteur);
-	sta_tsk(ID_Asserv1);
+	sta_tsk(ID_aff_lcd);
 	while(1)
     {
 		LED_J=1;
Index: branch/Styves_POUOTONG/tp_info6/Emb_App/conf_noyau.cfg
===================================================================
--- branch/Styves_POUOTONG/tp_info6/Emb_App/conf_noyau.cfg	(revision 495)
+++ branch/Styves_POUOTONG/tp_info6/Emb_App/conf_noyau.cfg	(revision 496)
@@ -89,6 +89,15 @@
 	exinf	= 0x0;
 };
 task[]{
+	entry_address	= aff_lcd();
+	name	= ID_aff_lcd;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 3;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
+task[]{
 	entry_address	= capteur();
 	name	= ID_capteur;
 	stack_size	= 256;
