Index: branch/lepogam/Emb_App.tws
===================================================================
--- branch/lepogam/Emb_App.tws	(revision 223)
+++ branch/lepogam/Emb_App.tws	(revision 224)
@@ -11,8 +11,8 @@
 "E:\tp_info6_lepogam\Emb_App\crt0mr.a30" 
 "E:\tp_info6_lepogam\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
-"E:\tp_info6_lepogam\Emb_App\conf_noyau.cfg" 0 0 1430 351 0 2 
-"E:\tp_info6_lepogam\Emb_App\crt0mr.a30" 150 150 1430 351 0 1 
+"E:\tp_info6_lepogam\Emb_App\conf_noyau.cfg" 0 0 1430 351 0 1 
+"E:\tp_info6_lepogam\Emb_App\crt0mr.a30" 100 100 1430 351 0 2 
 "E:\tp_info6_lepogam\Emb_App\programme_principal_etud.c" -8 -30 1596 539 1 0 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
Index: branch/lepogam/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/lepogam/Emb_App/SessionM32C_E8a_system.ini	(revision 223)
+++ branch/lepogam/Emb_App/SessionM32C_E8a_system.ini	(revision 224)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff002e
+RESET=ff0030
Index: branch/lepogam/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/lepogam/Emb_App/SessionM32C_E8a_system.hsf	(revision 223)
+++ branch/lepogam/Emb_App/SessionM32C_E8a_system.hsf	(revision 224)
@@ -149,11 +149,11 @@
 "{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" "0000000000FF313C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF3297" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A00" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000804" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000002CA2" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A42" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000846" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000004" 
 "{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" 
@@ -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" "0000000000000002" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "00000000000800FF" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A00" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000004" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000512" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A42" 
 "{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" 
@@ -277,7 +277,7 @@
 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 1 "0.09" 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 1 "0.08" 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_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 0 "0.11" 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" 
@@ -358,5 +358,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 52067208 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 90544424 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/lepogam/Emb_App/programme_principal_etud.c
===================================================================
--- branch/lepogam/Emb_App/programme_principal_etud.c	(revision 223)
+++ branch/lepogam/Emb_App/programme_principal_etud.c	(revision 224)
@@ -126,8 +126,8 @@
 unsigned int couleur=0; // vert -> ligne droie
 unsigned int distance_ref=700;
 unsigned int consigne=450;
-unsigned int consigne_vitesse=60;
-unsigned int vitesse_min=28;
+unsigned int consigne_vitesse=34;
+unsigned int vitesse_min=24;
 unsigned int valeur_t=0;
 unsigned int valeur_r=0;
 int k1=2;
@@ -155,11 +155,12 @@
 		comm.data.rtr=0; 
 		comm.data.val=valeur_t;
 		snd_dtq (CanTx,comm.msg);
+		
 		dly_tsk(50);
 		}
 	}
 
-void asserv1(){
+void asserv1(){ //asservissement tourelle
 	if(alpha!=consigne) valeur_t=k1*(consigne-alpha);
 	}
 
@@ -177,7 +178,7 @@
 		demande.data.rtr=1;
 	
 		snd_dtq (CanTx,demande.msg); // Interrogation du peripherique
-		if (periph[ADDR('U')].val<1000) distance=periph[ADDR('U')].val; // contient la valeur de retour du simulateur.
+		if (periph[ADDR('U')].val<1000) distance=periph[ADDR('U')].val; // contient la valeur de retour du simulateur et filtre
 	
 	
 		comm.data.id='D'; 
@@ -184,12 +185,15 @@
 		comm.data.rtr=0; 
 		comm.data.val=valeur_r;
 		snd_dtq (CanTx,comm.msg);
-		dly_tsk(6);
+		dly_tsk(10);
 		}
 
 	}
-void asserv2(){
-	if(distance!=distance_ref) valeur_r=-k2*(distance_ref-distance);
+void asserv2(){ //asservissement roue
+	if(couleur==0x1c80) ; // bloc rouge grand valeur 2 avant saut
+	else {
+		if(distance!=distance_ref) valeur_r=-k2*(distance_ref-distance);
+		}
 	}
 
 void asserv_vitesse(){
@@ -204,19 +208,22 @@
 		comm.data.rtr=0; 
 		comm.data.val=vitesse;
 		snd_dtq (CanTx,comm.msg);
-	
+		
 		demande.data.id='C'; 
 		demande.data.rtr=1;
 	
 		snd_dtq (CanTx,demande.msg); // Interrogation du peripherique
 		couleur=periph[ADDR('C')].val>>2; // contient la valeur de retour du simulateur.
+		
 		dly_tsk(100);
 		}
 	}
-void asserv3(){
-	if(couleur==0x1580 || couleur==0x1581 ) vitesse=consigne_vitesse;
+void asserv3(){ //asservisement vitesse
+	if(couleur==0x1580 || couleur==0x1581 ) vitesse=consigne_vitesse; // vert=ligne droite
+	else if(couleur==0x1c80) vitesse=45; // vitesse saut
+	else if(couleur==0x1c88) vitesse=14; //vitesse après saut,  bloc rouge grand valeur 32 après saut
 	else{
-		vitesse=vitesse_min;
+		vitesse=vitesse_min; //virage
 		}
 	}
 
@@ -225,7 +232,7 @@
 	ports_mcu();
     lcd_init();
 	periph_init();
-	periph_nom("#AutoTest*");
+	periph_nom("#Batmobile*");
 
     can_init();
     clavier_init(1);
@@ -239,13 +246,13 @@
 	sta_cyc(ID_asserv1);
 	sta_cyc(ID_asserv2);
 	
-	dly_tsk(600);	
+	dly_tsk(600);	// attente mise en place de la tourelle
 	sta_tsk(ID_asserv_vitesse);
 	sta_cyc(ID_asserv3);
 
     while(1)
     {
-	
+
     }
 }
 
Index: branch/lepogam/Emb_App/EmbM32C87App.tps
===================================================================
--- branch/lepogam/Emb_App/EmbM32C87App.tps	(revision 223)
+++ branch/lepogam/Emb_App/EmbM32C87App.tps	(revision 224)
@@ -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" 
