Index: branch/vilain_sebastien/Emb_App.tws
===================================================================
--- branch/vilain_sebastien/Emb_App.tws	(revision 378)
+++ branch/vilain_sebastien/Emb_App.tws	(revision 379)
@@ -7,6 +7,7 @@
 [GENERAL_DATA]
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
+"E:\tp_info6_2018_vilain_sebastien\bsp\clavier.c" 
 "E:\tp_info6_2018_vilain_sebastien\bsp\periph.c" 
 "E:\tp_info6_2018_vilain_sebastien\bsp\uart0.c" 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\conf_noyau.cfg" 
@@ -18,6 +19,7 @@
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\conf_noyau.cfg" 50 50 1430 351 0 2 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\crt0mr.a30" 0 0 1596 539 0 1 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\programme_principal_etud.c" -8 -30 1596 539 1 0 
+"E:\tp_info6_2018_vilain_sebastien\bsp\clavier.c" 150 150 1430 351 0 6 
 "E:\tp_info6_2018_vilain_sebastien\bsp\periph.c" 75 75 1430 351 0 3 
 "E:\tp_info6_2018_vilain_sebastien\bsp\uart0.c" 125 125 1430 351 0 5 
 [LOADED_PROJECTS]
Index: branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.ini	(revision 378)
+++ branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.ini	(revision 379)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0026
+RESET=ff0028
Index: branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.hsf	(revision 378)
+++ branch/vilain_sebastien/Emb_App/SessionM32C_E8a_system.hsf	(revision 379)
@@ -141,8 +141,8 @@
 "{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" "0000000000004044" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000020" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000056" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_10" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_11" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_12" "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" "0000000000FF058D" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF05AE" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A46" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000868" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004044" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "000000000000115E" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000087E" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "00000000000000FF" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000040C0" 
 "{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" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "000000000000000F" 
 "{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" "000000000000000A" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A64" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000C10000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000001172" 
 "{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" 
@@ -215,7 +215,9 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "num_piste, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "5" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "etat_feu, 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}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -319,10 +321,11 @@
 [WINDOW_Z_ORDER]
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\crt0mr.a30" 
-"E:\tp_info6_2018_vilain_sebastien\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_vilain_sebastien\bsp\periph.c" 
 "E:\tp_info6_2018_vilain_sebastien\bsp\uart0.c" 
-"E:\tp_info6_2018_vilain_sebastien\bsp\periph.c" 
+"E:\tp_info6_2018_vilain_sebastien\bsp\clavier.c" 
 "E:\tp_info6_2018_vilain_sebastien\Emb_App\conf_noyau.cfg" 
+"E:\tp_info6_2018_vilain_sebastien\Emb_App\Debug\mr308.inc" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -369,5 +372,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 98315368 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 99888232 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/vilain_sebastien/Emb_App/programme_principal_etud.c
===================================================================
--- branch/vilain_sebastien/Emb_App/programme_principal_etud.c	(revision 378)
+++ branch/vilain_sebastien/Emb_App/programme_principal_etud.c	(revision 379)
@@ -135,6 +135,7 @@
 int asserv_off = 0;
 short lecture;
 short num_piste;
+short etat_feu = 0;
 int vit_spe = 0;
 int vit_spe2 = 0;
 int vit_spe3 = 0;
@@ -168,13 +169,10 @@
 
 	init_vitesse();
 	
-    while(1)
-    {
-		LED_J=1;
-		dly_tsk(100);
-		LED_J=0;
-		dly_tsk(100);
-    }
+    while(1)
+	{
+		dly_tsk(100);
+	}
 }
 
 void acqui()
@@ -251,6 +249,7 @@
 			if((abs(dist) >= 2000))
 			{
 				dist = ancien_dist;
+				sta_tsk(ID_allum_jaune);
 			}
 			erreur = K1*(consigne_telemetre-dist);
 			if (telemetre_a_droite == 1)
@@ -264,6 +263,15 @@
 	}
 }
 
+void allum_jaune()
+{
+	LED_J = 1;
+	dly_tsk(1000);
+	LED_J = 0;
+	ext_tsk();
+}
+
+
 void commande_vitesse(short vitesse)
 {	
 	CanFrame comm;
@@ -284,29 +292,40 @@
 {
 	while(1)
 	{
-		if (vit_spe)
+		if (Bp_G == 1)
 		{
+			commande_vitesse(0);
+			LED_R = 1;
+		}
+		else if (vit_spe && (Bp_G == 0))
+		{
 			commande_vitesse(45);
+			LED_R = 0;
 		}
-		else if (vit_spe2)
+		else if (vit_spe2 && (Bp_G == 0))
 		{
-			commande_vitesse(10);
+			commande_vitesse(30);
+			LED_R = 0;
 		}
-		else if (vit_spe3)
+		else if (vit_spe3 && (Bp_G == 0))
 		{
 			commande_vitesse(43);
+			LED_R = 0;
 		}
-		else if (vit_spe4)
+		else if (vit_spe4 && (Bp_G == 0))
 		{
-			commande_vitesse(30);
+			commande_vitesse(15);
+			LED_R = 0;
 		}
-		else if ((angle_roues > 50) || (angle_roues < -50))
+		else if ((angle_roues > 50) || (angle_roues < -50) && (Bp_G == 0))
 		{
 			commande_vitesse(20);
+			LED_R = 0;
 		}
-		else
+		else if (Bp_G == 0)
 		{
 			commande_vitesse(60);
+			LED_R = 0;
 		}
 	}
 	dly_tsk(100);
@@ -347,10 +366,6 @@
 		{
 			asserv_off = 0;
 		}
-		if (lecture == 0x7603) //vert id 03
-		{
-			commande_vitesse(20);
-		}
 		if (lecture == 0x7602) //vert id 02
 		{
 			vit_spe = 1;
@@ -374,16 +389,21 @@
 		}
 		if (lecture == 0x7608) //vert id 08
 		{
-			asserv_off = 1;
 			vit_spe3 = 1;
 		}
 		if (lecture == 0x7609) //vert id 09
 		{
 			vit_spe4 = 0;
+			consigne_telemetre = 500;
+			dly_tsk(700);
+			consigne_telemetre = 705;
 		}
 		if (lecture == 0x760a) //vert id 10
 		{
 			vit_spe4 = 1;
+			consigne_telemetre = 500;
+			dly_tsk(700);
+			consigne_telemetre = 300;
 		}
 		if (lecture == 0x7201) //rouge id 1
 		{
@@ -396,9 +416,9 @@
 		if (lecture == 0x6301) //cyan id 1
 		{
 			consigne_angle = 700;
-			consigne_telemetre = 525;
+			consigne_telemetre = 530;
 			telemetre_a_droite = 1;
-			K1 = 3;
+			K1 = 2.9;
 		}
 		if (lecture == 0x6302) //cyan id 2
 		{
@@ -410,9 +430,9 @@
 		if (lecture == 0x6303) //cyan id 3
 		{
 			consigne_angle = -700;
-			consigne_telemetre = 525;
+			consigne_telemetre = 530;
 			telemetre_a_droite = 0;
-			K1 = 3;
+			K1 = 2.9;
 		}
 		dly_tsk(100);
 	}
@@ -434,7 +454,11 @@
 {
 	while(1)
 	{
-		num_piste = (lecture_course() & 0x00FF);
+		short lecture_M;
+		lecture_M = lecture_course();
+		num_piste = (lecture_M & 0x00FF);
+		etat_feu = ((lecture_M & 0x8000) >> 15);
 		dly_tsk(100);
 	}
-}
\ No newline at end of file
+}
+
Index: branch/vilain_sebastien/Emb_App/conf_noyau.cfg
===================================================================
--- branch/vilain_sebastien/Emb_App/conf_noyau.cfg	(revision 378)
+++ branch/vilain_sebastien/Emb_App/conf_noyau.cfg	(revision 379)
@@ -2,7 +2,7 @@
 //
 //    kernel.cfg : building file for MR308 Ver.4.00
 //
-//    Generated by M3T-MR308 GUI Configurator at 2018/12/18 14:42:59
+//    Generated by M3T-MR308 GUI Configurator at 2018/12/20 16:51:02
 //
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -20,7 +20,7 @@
 
 // max definition
 maxdefine{
-	max_task	= 8;
+	max_task	= 9;
 	max_flag	= 3;
 	max_dtq	= 2;
 	max_cyh	= 1;
@@ -106,6 +106,15 @@
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
+task[]{
+	entry_address	= allum_jaune();
+	name	= ID_allum_jaune;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 10;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
 
 flag[]{
 	name	= ev_bus_fin_tr;
Index: branch/vilain_sebastien/Emb_App/conf_noyau.hcf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
