Index: branch/mendiondo/Emb_App.tws
===================================================================
--- branch/mendiondo/Emb_App.tws	(revision 536)
+++ branch/mendiondo/Emb_App.tws	(revision 537)
@@ -8,6 +8,7 @@
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
 "E:\tp_info6_2018_mendiondo\tp_info6\bsp\can.c" 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\lcd.c" 
 "E:\tp_info6_2018_mendiondo\tp_info6\bsp\periph.c" 
 "E:\tp_info6_2018_mendiondo\tp_info6\bsp\periph.h" 
 "E:\tp_info6_2018_mendiondo\tp_info6\bsp\radiocommande.c" 
@@ -19,17 +20,18 @@
 "E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\Debug\sys_rom.inc" 
 "E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
-"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\Debug\mr308.inc" 0 638 160 38 0 9 
+"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\Debug\mr308.inc" 0 0 160 38 0 9 
 "E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\Debug\mrtable.a30" 25 25 1380 465 0 10 
-"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\Debug\sys_rom.inc" 1280 634 160 38 0 6 
-"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\conf_noyau.cfg" 320 634 160 38 0 4 
-"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\crt0mr.a30" -8 -30 1596 580 1 1 
-"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\programme_principal_etud.c" 160 638 160 38 0 0 
-"E:\tp_info6_2018_mendiondo\tp_info6\bsp\can.c" 1120 634 160 38 0 3 
-"E:\tp_info6_2018_mendiondo\tp_info6\bsp\periph.c" 640 634 160 38 0 5 
-"E:\tp_info6_2018_mendiondo\tp_info6\bsp\periph.h" 960 634 160 38 0 8 
-"E:\tp_info6_2018_mendiondo\tp_info6\bsp\radiocommande.c" 800 634 160 38 0 2 
-"E:\tp_info6_2018_mendiondo\tp_info6\bsp\uart0.c" 480 634 160 38 0 7 
+"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\Debug\sys_rom.inc" 0 0 160 38 0 6 
+"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\conf_noyau.cfg" 0 0 160 38 0 4 
+"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\crt0mr.a30" 0 0 1596 580 0 1 
+"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 1596 580 1 0 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\can.c" 0 0 160 38 0 3 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\lcd.c" 75 75 1405 367 0 11 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\periph.c" 0 0 160 38 0 5 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\periph.h" 0 0 160 38 0 8 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\radiocommande.c" 0 0 160 38 0 2 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\uart0.c" 0 0 160 38 0 7 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
 [END]
Index: branch/mendiondo/Emb_App/SessionM32C_FoUSB_UART.hsf
===================================================================
--- branch/mendiondo/Emb_App/SessionM32C_FoUSB_UART.hsf	(revision 536)
+++ branch/mendiondo/Emb_App/SessionM32C_FoUSB_UART.hsf	(revision 537)
@@ -1,7 +1,7 @@
 [HIMDBVersion]
 2.0
 [DATABASE_VERSION]
-"2.2" 
+"2.3" 
 [SESSION_DETAILS]
 "" 
 [INFORMATION]
@@ -226,6 +226,8 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+[TARGET_NAME]
+"M32C FoUSB/UART" "" 0 
 [STATUSBAR_STATEINFO_VD1]
 "MasterShowState" 1 
 "ApplicationShowState" 1 
@@ -246,8 +248,6 @@
 [STATUSBAR_DEBUGGER_PANESTATE_VD2]
 [STATUSBAR_DEBUGGER_PANESTATE_VD3]
 [STATUSBAR_DEBUGGER_PANESTATE_VD4]
-[TARGET_NAME]
-"M32C FoUSB/UART" 
 [DEBUGGER_OPTIONS]
 "Unknown Options" 
 [DOWNLOAD_MODULES]
@@ -264,6 +264,8 @@
 "FALSE" 
 [DISABLE_MEMORY_ACCESS_DURING_EXECUTION]
 "FALSE" 
+[DEBUGGER_OPTIONS_PROPERTIES]
+"0" 
 [COMMAND_FILES]
 [DEFAULT_DEBUG_FORMAT]
 "IEEE695_RENESAS" 
Index: branch/mendiondo/Emb_App/SessionM32C_Simulator.hsf
===================================================================
--- branch/mendiondo/Emb_App/SessionM32C_Simulator.hsf	(revision 536)
+++ branch/mendiondo/Emb_App/SessionM32C_Simulator.hsf	(revision 537)
@@ -1,7 +1,7 @@
 [HIMDBVersion]
 2.0
 [DATABASE_VERSION]
-"2.2" 
+"2.3" 
 [SESSION_DETAILS]
 "" 
 [INFORMATION]
@@ -34,6 +34,8 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+[TARGET_NAME]
+"" "" 0 
 [STATUSBAR_STATEINFO_VD1]
 "MasterShowState" 1 
 "ApplicationShowState" 1 
@@ -54,8 +56,6 @@
 [STATUSBAR_DEBUGGER_PANESTATE_VD2]
 [STATUSBAR_DEBUGGER_PANESTATE_VD3]
 [STATUSBAR_DEBUGGER_PANESTATE_VD4]
-[TARGET_NAME]
-"" 
 [DEBUGGER_OPTIONS]
 "" 
 [DOWNLOAD_MODULES]
@@ -71,6 +71,8 @@
 "FALSE" 
 [DISABLE_MEMORY_ACCESS_DURING_EXECUTION]
 "FALSE" 
+[DEBUGGER_OPTIONS_PROPERTIES]
+"0" 
 [COMMAND_FILES]
 [DEFAULT_DEBUG_FORMAT]
 "" 
Index: branch/mendiondo/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/mendiondo/Emb_App/SessionM32C_E8a_system.ini	(revision 536)
+++ branch/mendiondo/Emb_App/SessionM32C_E8a_system.ini	(revision 537)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0020
+RESET=ff0162
Index: branch/mendiondo/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/mendiondo/Emb_App/SessionM32C_E8a_system.hsf	(revision 536)
+++ branch/mendiondo/Emb_App/SessionM32C_E8a_system.hsf	(revision 537)
@@ -196,20 +196,20 @@
 "{55384715-F881-421C-A548-D7D1ABE158E1}PDMRWndInstanceKey1" "{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system0" 
 "{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_1" "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" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_12" "0000000000000000" 
 "{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" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF001C" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000700" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_15" "0000000000000512" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF05B0" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A48" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000086A" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000044" 
 "{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" 
@@ -224,12 +224,12 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_31" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_32" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_33" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "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" "0000000000000000" 
+"{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" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A66" 
+"{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" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_COUNT" "36" 
@@ -278,7 +278,13 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007_SCOPE" "Current Scope," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008" "piste, 1, 0, P, Col, Bin, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "9" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0009" "temps, 2, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0009_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010" "tour, 2, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010_SCOPE" "Global," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0011" "feu, 2, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0011_SCOPE" "Global," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "12" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -885,16 +891,16 @@
 0 
 [WINDOW_POSITION_STATE_DATA_VD1]
 "Help" "TOOLBAR 0" 59419 2 5 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
-"{WK_00000001_CmdLine}" "WINDOW" 59422 0 2 "0.07" 324 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 3 "0.06" 324 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 1 "0.04" 324 0 0 350 200 18 0 "32774|32775|32777|<<separator>>|32780|<<separator>>" "0.0" 
+"{WK_00000001_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 1 "0.02" 324 0 0 350 200 18 0 "32774|32775|32777|<<separator>>|32780|<<separator>>" "0.0" 
 "{WK_00000001_IO}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 0 "0.07" 324 0 0 350 200 18 0 "32817|32826|32819|32820|32821|32829" "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.10" 324 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_system0" "WINDOW" 59422 0 4 "0.30" 324 0 0 350 200 18 0 "47300|47301|47302|47303|47304|47305|47314|47306|47307|47308|47311|47312|47313|42211|42509|42303" "0.0" 
+"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 4 "0.42" 324 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_system0" "WINDOW" 59422 0 2 "0.03" 324 0 0 350 200 18 0 "47300|47301|47302|47303|47304|47305|47314|47306|47307|47308|47311|47312|47313|42211|42509|42303" "0.0" 
 "{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 5 "0.01" 324 0 0 350 200 18 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 6 "0.49" 324 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 6 "0.45" 324 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 2 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" 
@@ -919,8 +925,9 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\crt0mr.a30" 
-"E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\programme_principal_etud.c" 
+"E:\tp_info6_2018_mendiondo\tp_info6\bsp\lcd.c" 
 "E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_mendiondo\tp_info6\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_mendiondo\tp_info6\bsp\uart0.c" 
@@ -976,5 +983,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 100081440 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 89790576 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/mendiondo/Emb_App/programme_principal_etud.c
===================================================================
--- branch/mendiondo/Emb_App/programme_principal_etud.c	(revision 536)
+++ branch/mendiondo/Emb_App/programme_principal_etud.c	(revision 537)
@@ -127,11 +127,21 @@
 unsigned int alpha;j;
 unsigned int dist;
 unsigned int k=2,cpt=0;ka=1;
-unsigned int numero_capt,couleur_capt,couleur_piste,couleur,num_piste,feu,ok=0,tour=0;
+unsigned int numero_capt,couleur_capt,couleur_piste,couleur,num_piste,feu,ok=0,tour=0,temps=0;
 unsigned short capteur;piste;
+unsigned char c[]="";
+char ca[]="";
 
-
-	 
+void arret(){
+	CanFrame comm;
+	while(1){
+		comm.data.id='V';
+		comm.data.rtr=0;
+	 	comm.data.val=0;
+		snd_dtq(CanTx,comm.msg);
+		dly_tsk(50);
+	}
+}
 void avancer(){
 	CanFrame comm;
 	
@@ -146,12 +156,15 @@
 					ka=1;
 					comm.data.val=65;											// 75 pour niveaux 1 , 65 pour 2, 45 pour 3
 				}
-				else if (tour==3)comm.data.val=0;
+				else if(tour== 3)comm.data.val=0;
 				else{
-					comm.data.val=35;											// 30	1,2,3	20    4		vitesse virage
+					comm.data.val=30;											// 30	1,2,3	20    4		vitesse virage
 					k=6;														
 				}
 				snd_dtq(CanTx,comm.msg);
+		//		lcd_com(0xC0);
+		//		ca="piste verte";
+				
 	//	dly_tsk(100);
 			break;
 				
@@ -160,7 +173,7 @@
 				if (cpt%2 ==1){
 					k=2;														
 					ka=1;
-					comm.data.val=65;											// 75 pour niveaux 1 , 65 pour 2, 45 pour 3
+					comm.data.val=50;											// 75 pour niveaux 1 , 65 pour 2, 45 pour 3
 				}
 				else if (tour==3)comm.data.val=0;
 				else{
@@ -168,6 +181,9 @@
 					k=6;														
 				}
 				snd_dtq(CanTx,comm.msg);
+		//		lcd_com(0xC0);
+		//		lcd_str("piste bleue");
+				
 	//	dly_tsk(100);
 			break;
 					
@@ -189,7 +205,7 @@
 				else if (cpt%2 ==1){
 					k=2;														
 					ka=1;
-					comm.data.val=50;											// 75 pour niveaux 1 , 65 pour 2, 45 pour 3
+					comm.data.val=45;											// 75 pour niveaux 1 , 65 pour 2, 45 pour 3
 				}
 				
 				else{
@@ -197,6 +213,9 @@
 					k=6;														
 				}
 				snd_dtq(CanTx,comm.msg);
+		//		lcd_com(0xC0);
+		//		lcd_str("piste rouge");
+				
 	//	dly_tsk(100);
 			break;
 				
@@ -242,6 +261,9 @@
 					k=2;														
 				}
 				snd_dtq(CanTx,comm.msg);
+		//		lcd_com(0xC0);
+		//		lcd_str("piste noire");
+				
 	//	dly_tsk(100);
 			break;		
 				
@@ -311,11 +333,8 @@
 					snd_dtq(CanTx, req.msg);
 					wai_flg(ev_periph, 0x02,TWF_ANDW, &flag);
 					dist=periph[ADDR('U')].val;								//lecture de la distance
-				/*	if((dist=0)||(dist>2000)){
-						LED_J=1;
-						dly_tsk(1000);
-					}
-				*/		
+				
+						
 					
 					if(dist<1500){
 						comm.data.id='D';
@@ -346,12 +365,12 @@
 				if ((numero_capt==1024)&&(couleur_capt==118)){				// on passe le capteur saut du niveau 3
 					dly_tsk(220);
 				}
-				
 				periph[ADDR('U')].ev=0x02;
 				snd_dtq(CanTx, req.msg);
 				wai_flg(ev_periph, 0x02,TWF_ANDW, &flag);
 				dist=periph[ADDR('U')].val;								//lecture de la distance
 				if((dist<1500)&&(dist>400)){
+			//		LED_J=0;
 					comm.data.id='D';
 					comm.data.rtr=0;
 					comm.data.val=ka*(-710 +dist);
@@ -364,11 +383,14 @@
 				snd_dtq(CanTx, req.msg);
 				wai_flg(ev_periph, 0x02,TWF_ANDW, &flag);
 				dist=periph[ADDR('U')].val;								//lecture de la distance
+
 				if((dist<1500)&&(dist>400)){
+					LED_J=0;
 					comm.data.id='D';
 					comm.data.rtr=0;
 					comm.data.val=ka*(-710 +dist);
 				}
+				else LED_J=1;
 			snd_dtq(CanTx, comm.msg);	
 			break;
 		}
@@ -400,7 +422,7 @@
 		}						
 		couleur=couleur_capt;
 		
-		dly_tsk(100);
+		dly_tsk(10);
 	}
 }
 
@@ -424,8 +446,38 @@
 	}
 }
 	
-
-
+void chrono (){
+	CanFrame req;
+	UINT flag;
+	while (1){
+		req.data.id='H';
+		req.data.rtr=1;
+		periph[ADDR('H')].ev=0x05;
+		snd_dtq(CanTx, req.msg);
+		wai_flg(ev_periph, 0x05, TWF_ANDW, &flag);
+		temps=periph[ADDR('H')].val;
+		sprintf(c,"%d",temps);
+		lcd_str(c);
+		lcd_com(0xC0);
+	//	lcd_str(ca);
+		switch (num_piste){
+			case (256):
+				lcd_str("piste verte");
+				break;
+			case (512):
+				lcd_str("piste bleue");
+				break;
+			case (768):
+				lcd_str("piste rouge");
+				break;
+			case (1024):
+				lcd_str("piste noire");
+				break;
+		}
+		dly_tsk(800);
+		lcd_init();
+	}
+}
 void main()
 {
 	ports_mcu();
@@ -444,27 +496,32 @@
 	sta_tsk(ID_asserv_tourelle);
 	sta_tsk(ID_distance);
 	sta_tsk(ID_capte);
+//	sta_tsk(ID_chrono);
 	
-	
 	
    	while(1){
     
-	dly_tsk(1000);
+	dly_tsk(100);
 	
 	if (feu == 65535){
-		ok=1;
+		ok++;
 	}
 	if(ok == 1){
 		sta_tsk(ID_avancer);
 	}
-	if(tour == 3)/*||(Bp_G==1))*/{
+	if((tour== 3)||(Bp_D==1)){
 		ter_tsk(ID_pistes);
+	//	ok=0;
 		ter_tsk(ID_avancer);
-		ok=0;
+		sta_tsk(ID_arret);
 		ter_tsk(ID_asserv_tourelle);
 		ter_tsk(ID_distance);
 		ter_tsk(ID_capte);
-		ter_tsk(ID_periph_rx);		
+		ter_tsk(ID_periph_rx);
+//		ter_tsk(ID_chrono);	
+		ter_tsk(ID_arret);
+		LED_R=1;
+		
 	}
 	}	
 }
Index: branch/mendiondo/Emb_App/conf_noyau.cfg
===================================================================
--- branch/mendiondo/Emb_App/conf_noyau.cfg	(revision 536)
+++ branch/mendiondo/Emb_App/conf_noyau.cfg	(revision 537)
@@ -106,7 +106,24 @@
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
-
+task[]{
+	entry_address	= arret();
+	name	= ID_arret;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 6;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
+task[]{
+	entry_address	= chrono();
+	name	= ID_chrono;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 8;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
 flag[]{
 	name	= ev_bus_fin_tr;
 	initial_pattern	= 0x0000;
