Index: branch/beaussant/Emb_App.tws
===================================================================
--- branch/beaussant/Emb_App.tws	(revision 539)
+++ branch/beaussant/Emb_App.tws	(revision 540)
@@ -15,9 +15,11 @@
 "E:\tp_info6_2018_beaussant\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_beaussant\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_beaussant\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_beaussant\Emb_App\Debug\mrtable.a30" 
 "E:\tp_info6_2018_beaussant\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
 "E:\tp_info6_2018_beaussant\Emb_App\Debug\mr308.inc" 0 0 1430 352 0 7 
+"E:\tp_info6_2018_beaussant\Emb_App\Debug\mrtable.a30" 50 50 1430 352 0 9 
 "E:\tp_info6_2018_beaussant\Emb_App\conf_noyau.cfg" 0 0 1430 351 0 3 
 "E:\tp_info6_2018_beaussant\Emb_App\crt0mr.a30" 150 150 1430 351 0 2 
 "E:\tp_info6_2018_beaussant\Emb_App\programme_principal_etud.c" -8 -30 1596 540 1 0 
Index: branch/beaussant/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/beaussant/Emb_App/SessionM32C_E8a_system.hsf	(revision 539)
+++ branch/beaussant/Emb_App/SessionM32C_E8a_system.hsf	(revision 540)
@@ -142,7 +142,7 @@
 "{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" "0000000000000001" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000014" 
 "{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" "0000000000FF3172" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF3430" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A56" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000085A" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000000C0" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000D6C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000870" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "000000000000FFFF" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000000C1" 
 "{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" "0000000000000007" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000F60000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A56" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000120012" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000120012" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000D6C" 
 "{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" 
@@ -205,32 +205,32 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth2" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth3" "200" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH" "c,buff,n,rx,flag," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "pos_obs, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "dist_obs, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "dist_obs, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "commandeR, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "consigne, 1, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "c, 10, 0, P, Col, Hex, N" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "commandeR, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "commandeV, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Global," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "val_capt, 2, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "etat_feu, 2, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "in, 1, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006" "cmpt, 1, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007" "is_stable, 1, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008" "commandeV, 1, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0009" "est_stable, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "modeCourse, 2, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005_SCOPE" "Global," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006" "dist_consigne, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006_SCOPE" "Global," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007" "borne, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008" "kr, 3, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0009" "num_piste, 2, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0009_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010" "dans, 1, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0011" "val_capt, 2, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010" "nbVirage, 10, 0, P, Col, Hex, N" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0011" "nbTour, 2, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0011_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0012" "etat_feu, 2, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0012_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0012" "dist_consigne, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0012_SCOPE" "Global," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0013" "modeCourse, 2, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0013_SCOPE" "Global," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0014" "dist_consigne, 1, 0, P, Col, Dec, MA" 
@@ -241,7 +241,7 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0016_SCOPE" "Current Scope," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0017" "num_piste, 2, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0017_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "18" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "13" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -346,11 +346,12 @@
 "E:\tp_info6_2018_beaussant\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_2018_beaussant\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_beaussant\Emb_App\conf_noyau.cfg" 
-"E:\tp_info6_2018_beaussant\bsp\lcd.c" 
-"E:\tp_info6_2018_beaussant\Emb_App\Debug\mr308.inc" 
-"E:\tp_info6_2018_beaussant\bsp\uart0.c" 
 "E:\tp_info6_2018_beaussant\bsp\clavier.c" 
+"E:\tp_info6_2018_beaussant\Emb_App\Debug\mrtable.a30" 
 "E:\tp_info6_2018_beaussant\bsp\periph.c" 
+"E:\tp_info6_2018_beaussant\bsp\uart0.c" 
+"E:\tp_info6_2018_beaussant\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_beaussant\bsp\lcd.c" 
 "E:\tp_info6_2018_beaussant\bsp\can.c" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
@@ -398,5 +399,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 90518704 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 92157104 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/beaussant/Emb_App/programme_principal_etud.c
===================================================================
--- branch/beaussant/Emb_App/programme_principal_etud.c	(revision 539)
+++ branch/beaussant/Emb_App/programme_principal_etud.c	(revision 540)
@@ -234,12 +234,12 @@
 
 void depart()
 {
+	lcd_init();
 	est_stable=0;
 	kv=0.8;
 	commandeV=15;
 	dist_obs=acquiFrame('U');
 	modeCourse=acquiFrame('M');
-	printLCD();
 	etat_feu=modeCourse>>15;
 	while(etat_feu!=1){
 		modeCourse=acquiFrame('M');
@@ -247,6 +247,7 @@
 		dly_tsk(20);
 	}
 	envoieFrame('V',commandeV);
+	printLCD();
 	while(est_stable!=1){
 		dist_obs=acquiFrame('U');
 		if(dist_obs<1000){  
@@ -278,7 +279,7 @@
 
 
 void asserv_roue()
-{
+{	
 	char num_capt;
 	char couleur_capt;
 	dist_obs=acquiFrame('U');
@@ -294,19 +295,19 @@
 			dist_obs=acquiFrame('U');
 		}
 		
-		dly_tsk(5);
+		dly_tsk(10);
 	}
 		
 }
 
 void comptageTour(){	
-	while(1){
+	whilezzzzzzzzzzzzzzzzz(1){
 		if(val_capt==67){
 			while(val_capt!=86) dly_tsk(20);;
 			nbTour++;
 		}
 	}
-	dly_tsk(20);		
+	dly_tsk(50);		
 }
 
 void asserv_vitesse()
@@ -316,9 +317,14 @@
 		if(Bp_G==1 || nbTour==3)
 		{
 			commandeV=0;
+			envoieFrame('V',commandeV);
+			sus_tsk(ID_asserv_r);
+			sus_tsk(ID_cmptT);		
 		}
 		else
 		{
+			rsm_tsk(ID_asserv_r);
+			rsm_tsk(ID_cmptT);	
 			dans=intervalle(commandeR,10);
 			switch(val_capt)
 			{
@@ -328,7 +334,7 @@
 					kr=0;
 					break;
 				case 98:
-					commandeV=41;
+					commandeV=42;
 					commandeR=0;
 					kr=0;
 					break;
@@ -337,7 +343,7 @@
 					kr=0.8;
 					break;
 				case 118:
-					commandeV=50;
+					commandeV=55;
 					commandeR=-7;
 					envoieFrame('D',commandeR);
 					kr=0;
@@ -348,8 +354,8 @@
 				case 66:
 					if(num_piste==3||num_piste==4)
 					{
-						commandeV=13;
-						kr=0.7;
+						commandeV=12;
+						kr=1.4;
 					}
 					else{
 						
@@ -387,7 +393,7 @@
 					}
 					else
 					{
-						commandeV=32;
+						commandeV=31;
 						kr=1.4;
 					}
 					break;
@@ -394,7 +400,7 @@
 				}		
 			
 		}
-		dly_tsk(5);
+		dly_tsk(10);
 	}
 }
 
