Index: branch/duvernois/Emb_App.tws
===================================================================
--- branch/duvernois/Emb_App.tws	(revision 357)
+++ branch/duvernois/Emb_App.tws	(revision 358)
@@ -7,17 +7,21 @@
 [GENERAL_DATA]
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
+"E:\tp_info6_2018_duvernois\tp_info6\bsp\uart0.c" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mrtable.a30" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\sys_rom.inc" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 50 50 1430 351 0 4 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 50 50 1430 351 0 3 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mrtable.a30" 150 150 1405 409 0 5 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\sys_rom.inc" 0 0 1430 351 0 2 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 150 150 1430 351 0 1 
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 25 25 1430 351 0 3 
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 1596 539 1 0 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" -8 -30 1596 572 1 4 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 0 
+"E:\tp_info6_2018_duvernois\tp_info6\bsp\uart0.c" 175 175 1405 359 0 6 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
 [END]
Index: branch/duvernois/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/duvernois/Emb_App/SessionM32C_E8a_system.ini	(revision 357)
+++ branch/duvernois/Emb_App/SessionM32C_E8a_system.ini	(revision 358)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0020
+RESET=ff001e
Index: branch/duvernois/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/duvernois/Emb_App/SessionM32C_E8a_system.hsf	(revision 357)
+++ branch/duvernois/Emb_App/SessionM32C_E8a_system.hsf	(revision 358)
@@ -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" "0000000000000001" 
-"{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" 
@@ -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" "0000000000FF32FC" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0576" 
 "{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" "000000000000084A" 
-"{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" "0000000000000B40" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000087A" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000004044" 
 "{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" "0000000000000006" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000120012" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A46" 
+"{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" "0000000000000B76" 
 "{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" 
@@ -199,7 +199,7 @@
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_VIEW" "0,0,0,0,0,0" 
 "{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ImageCtrlViews" "0" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchCtrlViews" "4" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth0" "148" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth0" "173" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth1" "186" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth12" "200" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ColWidth2" "120" 
@@ -213,15 +213,23 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Global," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "rotroue, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "maj, 10, 0, P, Col, Hex, N" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "consignetele, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "valsaut, 1, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "consigneposition, 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" "consignevitesse, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0006_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007" "Nump, 1, 0, P, Col, Dec, MA" 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "8" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0007" "Valvitesse, 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" "Nump, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0008_SCOPE" "Global," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0009" "Valpiste, 1, 0, P, Col, Bin, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0009_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010" "valcapt, 1, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0010_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0011" "Gainroue, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0011_SCOPE" "Current Scope," 
+"{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" 
@@ -291,14 +299,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 1 "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 1 "0.14" 332 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_EVENT}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 0 "0.11" 332 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" 
-"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 2 "0.62" 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_PDMR}EmbM32C87AppSessionM32C_E8a_system" "WINDOW" 59422 0 3 "0.01" 365 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 2 "0.63" 332 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 3 "0.01" 332 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 4 "0.25" 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 4 "0.25" 332 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" 
@@ -323,11 +331,13 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" 
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_duvernois\tp_info6\bsp\uart0.c" 
 "E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\sys_rom.inc" 
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mrtable.a30" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -374,5 +384,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 94360416 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 94050616 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/duvernois/Emb_App/programme_principal_etud.c
===================================================================
--- branch/duvernois/Emb_App/programme_principal_etud.c	(revision 357)
+++ branch/duvernois/Emb_App/programme_principal_etud.c	(revision 358)
@@ -123,16 +123,24 @@
 //				correspondant au nom du véhicule si le nom se termine par '*'
 
 	int alpha;
+	int var;
+	int valcapt;
+	int Nump;
+	int Valpiste;
+	int Valvitesse;
+	
 	int consignetourelle = 450;
+	int consigneposition;
+	int consignevitesse;
+	int Gainroue=1;
+	int consignetele;
+	
 	int rottourelle;
-	int consigneposition = 100;
-	short rotroue;
-	int var;
-	int valsaut;
-	int Gainroue=1;
-	int consignevitesse=20;	
-	int Nump;
-
+	int rotroue;
+	
+	int mask= 0x00FF;
+	
+		
 void position ()
 {	
 
@@ -152,8 +160,8 @@
 	wai_flg(ev_periph,0x01,TWF_ANDW, &flag);
 	var=periph[ADDR('U')].val; 
 	
-	rotroue=Gainroue*(var-715);
-	if (rotroue <= 650  && rotroue >= -650)
+	rotroue=Gainroue*(var-consigneposition);
+	if (rotroue < consignetele  && rotroue > -consignetele)
 		{
 		comm.data.id='D'; comm.data.rtr=0; comm.data.val=rotroue;
 		snd_dtq (CanTx,comm.msg);
@@ -163,7 +171,8 @@
 		comm.data.id='D'; comm.data.rtr=0; comm.data.val=0;
 		snd_dtq (CanTx,comm.msg);
 		}
-	dly_tsk(10);	
+	LED_J=!LED_J;
+	dly_tsk(25);		
 	}
 }
 
@@ -192,11 +201,12 @@
 	rottourelle=(consignetourelle-alpha);
 	comm.data.id='T'; comm.data.rtr=0; comm.data.val=rottourelle;
 	snd_dtq (CanTx,comm.msg);
-	dly_tsk(200);
+	dly_tsk(100);
 	}
 }
 
 
+
 void saut()
 {                
         //Tourelle periph[MAX_PERIPHS];
@@ -213,28 +223,29 @@
         snd_dtq(CanTx,demande.msg);        
                 dly_tsk(10);        
         wai_flg(ev_periph,0x01,TWF_ANDW, &flag);
-        valsaut=periph[ADDR('C')].val; 
-        Gainroue=1;        
-        consignevitesse=20;        
+        valcapt=periph[ADDR('C')].val; 
         
-        if (valsaut ==0x5603)
+        if (valcapt ==0x5603 && (Nump==3 ||Nump==7))
         {
-                Gainroue=0;
+              	Gainroue =0;
                 consignevitesse=45;
         }
-        if (valsaut ==0x4203)
+       else if (valcapt ==0x4203 &&(Nump==3 ||Nump==7))
         {
-                Gainroue=1;
-                consignevitesse=15;        
+                consignevitesse=10;  
+				Gainroue=1;      
         }
-        comm.data.id='V';
-        comm.data.rtr=0;
-        comm.data.val=consignevitesse;
-        snd_dtq (CanTx,comm.msg);
-        dly_tsk(100);
-        }
+		else
+		{
+		//	consignevitesse=Valvitesse; 
+		}
+
+		dly_tsk(100);
+		}
 }
 
+
+
 void Piste()
 {		
 	CanFrame demande;
@@ -241,8 +252,8 @@
 
 	UINT flag;
 	
-	while(1)
-	{	
+	
+		
 	demande.data.id='M'; 
 	demande.data.rtr=1;
 	periph[ADDR('M')].ev=0x01;
@@ -249,13 +260,78 @@
 	snd_dtq(CanTx,demande.msg);	
 		dly_tsk(10);	
 	wai_flg(ev_periph,0x01,TWF_ANDW, &flag);
-	Nump=periph[ADDR('M')].val; 
-	}
+	Valpiste=(periph[ADDR('M')]).val; 
+	Nump=(Valpiste & mask);
 }
 
+void noir()
+{                        
+        CanFrame comm;
+        CanFrame demande;
+        UINT flag;
+        
+        while(1)
+        {        
+        demande.data.id='C'; 
+        demande.data.rtr=1;
+        periph[ADDR('C')].ev=0x01;
+        snd_dtq(CanTx,demande.msg);        
+                dly_tsk(10);        
+        wai_flg(ev_periph,0x01,TWF_ANDW, &flag);
+        valcapt=periph[ADDR('C')].val; 
+        
+        if (valcapt ==0x5601)
+        {
+            consigneposition= 900;  
+			consignevitesse=20; 
+        }
+       else if (valcapt ==0x4a01)
+        {	
+			 consignevitesse=15; 
+             consigneposition=700;
+			 consignetele=1200;
+			 Gainroue=1;   
+        }
+		else if (valcapt ==0x5602)
+        {
+			consignetele=1;	
+			consignevitesse=14;  
+        }
+		else if (valcapt ==0x5202)
+        {
+			consignetele=300;	  
+        }
+		else if (valcapt ==0x5603)
+        {
+			consignetele=300;	
+			consignevitesse=45;   
+        }
+		else
+		{
+			consignevitesse=Valvitesse; 	 
+		}
 
+        LED_V=!LED_V;
+		dly_tsk(200);
+        }
+}
 
+
+void vitesse()
+{		
+	CanFrame comm;
 	
+	while(1)
+	{
+	comm.data.id='V';
+	comm.data.rtr=0; 
+	comm.data.val=consignevitesse;
+	snd_dtq (CanTx,comm.msg);
+	dly_tsk(100);
+	}
+	
+
+}	
 void main()
 {
 	ports_mcu();
@@ -270,16 +346,53 @@
 	sta_cyc(ID_acqui);
 	
 	sta_tsk(ID_periph_rx);
+	
 	sta_tsk(ID_Piste);
+	dly_tsk(1000);
+			
+	if (Nump == 1 || Nump == 5)
+	{
+		Valvitesse=30;
+		consignetele=600;
+		consigneposition = 715;
+		LED_V=!LED_V;
+	}
+	if (Nump == 2 || Nump == 6)
+	{
+		Valvitesse=30;
+		consignetele=600;
+		consigneposition = 715;
+		LED_V=!LED_V;
+	}
+	if (Nump == 3 || Nump == 7)
+	{
+		consignetele=600;
+		Valvitesse=20;
+		consigneposition = 715;
+		LED_V=!LED_V;
+	}
+	if (Nump == 4 || Nump == 8)
+	{
+		Valvitesse=15;
+		consignetele=250;
+		consigneposition=900;
+		Gainroue=1;
+		sta_tsk(ID_noir);
+		LED_V=!LED_V;
+	}
+	
+	dly_tsk(2000);	
 	sta_tsk(ID_tourelle);
+	sta_tsk(ID_saut);
+	sta_tsk(ID_position);
 	dly_tsk(2000);
-	sta_tsk(ID_position);
-	dly_tsk(100);
-	sta_tsk(ID_saut);
+	sta_tsk(ID_vitesse);
 
     while(1)
     {
-	
+
+					
+	dly_tsk(100);
 		
 		
    }
@@ -287,6 +400,6 @@
 
 void acqui()
 {
-	LED_V=!LED_V;
+ LED_R=!LED_R;
 }
 
Index: branch/duvernois/Emb_App/conf_noyau.cfg
===================================================================
--- branch/duvernois/Emb_App/conf_noyau.cfg	(revision 357)
+++ branch/duvernois/Emb_App/conf_noyau.cfg	(revision 358)
@@ -20,7 +20,7 @@
 
 // max definition
 maxdefine{
-	max_task	= 7;
+	max_task	= 9;
 	max_flag	= 3;
 	max_dtq	= 2;
 	max_cyh	= 1;
@@ -75,7 +75,7 @@
 	name	= ID_position;
 	stack_size	= 256;
 	stack_section	= stack;
-	priority	= 5;
+	priority	= 2;
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
@@ -84,7 +84,7 @@
 	name	= ID_saut;
 	stack_size	= 256;
 	stack_section	= stack;
-	priority	= 1;
+	priority	= 2;
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
@@ -93,10 +93,28 @@
 	name	= ID_Piste;
 	stack_size	= 256;
 	stack_section	= stack;
+	priority	= 9;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
+task[]{
+	entry_address	= vitesse();
+	name	= ID_vitesse;
+	stack_size	= 256;
+	stack_section	= stack;
 	priority	= 1;
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
+task[]{
+	entry_address	= noir();
+	name	= ID_noir;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 2;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
 flag[]{
 	name	= ev_bus_fin_tr;
 	initial_pattern	= 0x0000;
