Index: branch/porte/Emb_App.tws
===================================================================
--- branch/porte/Emb_App.tws	(revision 302)
+++ branch/porte/Emb_App.tws	(revision 303)
@@ -7,19 +7,13 @@
 [GENERAL_DATA]
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
-"E:\tp_info6_2018_porte\tp_info6\bsp\radiocommande.c" 
-"E:\tp_info6_2018_porte\tp_info6\bsp\uart0.c" 
 "E:\tp_info6_2018_porte\tp_info6\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_porte\tp_info6\Emb_App\crt0mr.a30" 
-"E:\tp_info6_2018_porte\tp_info6\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_porte\tp_info6\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
-"E:\tp_info6_2018_porte\tp_info6\Emb_App\Debug\mr308.inc" 0 0 1430 351 0 4 
 "E:\tp_info6_2018_porte\tp_info6\Emb_App\conf_noyau.cfg" 0 0 1426 347 0 0 
-"E:\tp_info6_2018_porte\tp_info6\Emb_App\crt0mr.a30" 125 125 1430 351 0 2 
-"E:\tp_info6_2018_porte\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 1596 539 1 1 
-"E:\tp_info6_2018_porte\tp_info6\bsp\radiocommande.c" 25 25 1430 351 0 5 
-"E:\tp_info6_2018_porte\tp_info6\bsp\uart0.c" 150 150 1430 351 0 3 
+"E:\tp_info6_2018_porte\tp_info6\Emb_App\crt0mr.a30" 125 125 1380 405 0 2 
+"E:\tp_info6_2018_porte\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 1596 643 1 1 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
 [END]
Index: branch/porte/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/porte/Emb_App/SessionM32C_E8a_system.hsf	(revision 302)
+++ branch/porte/Emb_App/SessionM32C_E8a_system.hsf	(revision 303)
@@ -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" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000000" 
 "{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" "0000000000FF056F" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF36EB" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000E60" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000886" 
-"{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" "0000000000000ACC" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "00000000000008D0" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "000000000000FFFF" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000000C0" 
 "{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" 
@@ -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" "0000000000000003" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000E82" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "000000000000000B" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000120000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000ACC" 
 "{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" 
@@ -207,15 +207,15 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH" "c,buff,n,rx,flag," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "Distance, 2, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "Bord_defaut, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "Info_capteur, 2, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "Info_capteur, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "Vitesse, 2, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "ErreurRoues, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "Num_circuit, 2, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "Bord_defaut, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "test, 2, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "3" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "5" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -285,14 +285,14 @@
 0 
 [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 0 "0.14" 365 0 0 350 200 17 0 "32771|32772|32778|<<separator>>|32773|32774|<<separator>>|32820|<<separator>>|32801|32824" "0.0" 
+"{WK_00000001_CmdLine}" "WINDOW" 59422 0 0 "0.14" 261 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_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 0 "0.12" 365 0 0 350 200 2065 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 1 "0.54" 365 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
+"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 1 "0.54" 261 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
 "{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 2 "0.39" 365 0 0 350 200 2065 0 "47300|47301|47302|47303|47304|47305|47314|47306|47307|47308|47311|47312|47313|42211|42509|42303" "0.0" 
 "{WK_00000001_REGISTERS}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59421 0 0 "1.00" 236 0 0 350 200 2065 0 "" "0.0" 
-"{WK_00000001_WATCH}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 2 "0.46" 365 0 0 350 200 18 0 "32781|32783|<<separator>>|32771|32772|32773|<<separator>>|32786|<<separator>>|32810|32811" "0.0" 
+"{WK_00000001_WATCH}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 2 "0.46" 261 0 0 350 200 18 0 "32781|32783|<<separator>>|32771|32772|32773|<<separator>>|32786|<<separator>>|32810|32811" "0.0" 
 "{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 308 0 0 350 200 18 0 "" "0.0" 
 "{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
 "{WK_TB00000002_EDITOR}" "TOOLBAR 0" 59419 0 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
@@ -320,9 +320,6 @@
 "E:\tp_info6_2018_porte\tp_info6\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_2018_porte\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_porte\tp_info6\Emb_App\conf_noyau.cfg" 
-"E:\tp_info6_2018_porte\tp_info6\bsp\radiocommande.c" 
-"E:\tp_info6_2018_porte\tp_info6\Emb_App\Debug\mr308.inc" 
-"E:\tp_info6_2018_porte\tp_info6\bsp\uart0.c" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -369,5 +366,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 93847448 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 93578536 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/porte/Emb_App/programme_principal_etud.c
===================================================================
--- branch/porte/Emb_App/programme_principal_etud.c	(revision 302)
+++ branch/porte/Emb_App/programme_principal_etud.c	(revision 303)
@@ -124,10 +124,9 @@
 const Vitesse_max=99, Vitesse_min=0;
 
 /*-------------------------------------- Variables ----------------------------------------*/
-unsigned int Angle_T=0;										//prend la valeur de l'angle au temps t-1
-unsigned int Consigne_T=500; 								//Consigne de l'angle de la tourelle
-unsigned int valeur=0; 										//valeur transmise corrigé
 //Variables pour l'asserivssement des roues, de la vitesse et du telemetre
+unsigned int Angle_T=0, Consigne_T=500;						//prend la valeur de l'angle au temps t-1 //Consigne de l'angle de la tourelle (consigne/10=>degrès)
+unsigned int valeur=0, Saut=0; 										//valeur transmise corrigé
 unsigned int Somme_Erreur=0, Erreur=0, Delta_Erreur=0, Erreur_pre=0;			
 unsigned int ErreurRoues=0, ErreurRouesPre=0, Delta_ErreurRoues=0,Somme_ErreurRoues=0;
 int Kpt=1,	Kpr=2;											//Paramètre des PID tourelle et roues
@@ -143,6 +142,9 @@
 short Touche_clavier;
 //Variable de la fonction Circuit
 unsigned int Info_circuit, Etat_feu, Num_circuit;
+//Variable de la fonction Evenement
+unsigned int Lecture_eve;
+FLGPTN test;
 
 
 void Asserv_T(){	
@@ -223,22 +225,26 @@
 	
 		comm.data.id='V'; 						//Commande de la vitesse des roues motrices
 		comm.data.rtr=0;
+
 		
-		//Rampe de vitesse au démarrage
-	/*	for(i=0;i++;Vitesse_final < Vitesse_commande){
-			comm.data.val=Vitesse_final-Vitesse_commande+i;
-			snd_dtq (CanTx,comm.msg);			//Envoi de la commande de vitesse
-			dly_tsk(100);
-		}*/
-		
-		if(Info_capteur == 0x560 && Bord_defaut == 0){				// Commande de vitesse pour les lignes droites (dernier capteur detecte = vert).
+		if(Info_capteur == 0x560){				// Commande de vitesse pour les lignes droites (dernier capteur detecte = vert).
 			comm.data.val=Vitesse;	
 			snd_dtq (CanTx,comm.msg);			// Envoi de la commande de vitesse
 		}
-		else{									// Ralentissement en cas de virage par 2 (selon valeur capteur) 
-			comm.data.val=Vitesse/2;	
+		else if(Info_capteur == 0x630 ){		//Accelération pour passer le saut
+			comm.data.val=Vitesse*1.66;	
 			snd_dtq (CanTx,comm.msg);
+			Saut=1;
 		}
+		else if(Info_capteur == 0x630 && Saut == 1){		//Ralentissement pour la reception du saut
+			comm.data.val=Vitesse/2.3;	
+			snd_dtq (CanTx,comm.msg);
+			Saut=0;
+		}
+		else{									// Ralentissement en cas de virage et de détection de trou ou d'obstacle.
+			comm.data.val=Vitesse/1.55;	
+			snd_dtq (CanTx,comm.msg);
+		}
 		
 		//lcd_str(char &Vitesse)
 				
@@ -337,13 +343,27 @@
 		snd_dtq (CanTx,demande.msg); 						// Interrogation du peripherique sur les information du circuit.
 		Info_circuit=periph[ADDR('M')].val;
 		Num_circuit=Info_circuit & 0x000F;
-		Etat_feu=Info_circuit >> 15; 						// contient la valeur de retour du simulateur sur le l'état du feu.
+		Etat_feu=Info_circuit >> 15; 						// contient la valeur de retour du simulateur sur l'état du feu.
 		
 		dly_tsk(200);
 	}
+		
+}
+
+void Evenement(){
 	
+	//'E'/69/0x45 : Lecture des evenements,
+	CanFrame comm;
+	CanFrame demande;
+	CanFrame reponse;
 	
+	while(1){
 		
+		wai_flg(event,(FLGPTN) 0x0800, TWF_ANDW,&test);
+		
+		dly_tsk(200);
+	}
+		
 }
 
 void main()
@@ -351,7 +371,7 @@
 	ports_mcu();
     lcd_init();
 	periph_init();
-	periph_nom("#AutoTest*");
+	periph_nom("#Troen*");
 
     can_init();
     clavier_init(1);
@@ -374,7 +394,9 @@
 	
 	sta_tsk(ID_Commande_IHM);
 	
-	sta_tsk(ID_Circuit);
+	sta_tsk(ID_Circuit);
+	
+	sta_tsk(ID_Evenement);
 		
     while(1)
     {
Index: branch/porte/Emb_App/conf_noyau.cfg
===================================================================
--- branch/porte/Emb_App/conf_noyau.cfg	(revision 302)
+++ branch/porte/Emb_App/conf_noyau.cfg	(revision 303)
@@ -131,6 +131,16 @@
 	exinf	= 0x0;
 };
 
+task[]{
+	entry_address	= Evenement();
+	name	= ID_Evenement;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 6;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
+
 flag[]{
 	name	= ev_bus_fin_tr;
 	initial_pattern	= 0x0000;
Index: branch/porte/Emb_App/EmbM32C87App.tps
===================================================================
--- branch/porte/Emb_App/EmbM32C87App.tps	(revision 302)
+++ branch/porte/Emb_App/EmbM32C87App.tps	(revision 303)
@@ -18,7 +18,7 @@
 "SessionM32C_E8a_system" 
 [GENERAL_DATA_PROJECT]
 [GENERAL_DATA_CONFIGURATION_Debug]
-"PROJECT_FILES_MODIFIED_DATA_TAG" "TRUE" 
+"PROJECT_FILES_MODIFIED_DATA_TAG" "FALSE" 
 [SESSIONS_Debug]
 "DefaultSession" 
 "SessionM32C_E8a_system" 
