Index: branch/duvernois/Emb_App.tws
===================================================================
--- branch/duvernois/Emb_App.tws	(revision 261)
+++ branch/duvernois/Emb_App.tws	(revision 262)
@@ -7,23 +7,17 @@
 [GENERAL_DATA]
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\can.c" 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\periph.c" 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.c" 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.h" 
 "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\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\sys_rom.inc" 0 0 1430 351 0 7 
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\conf_noyau.cfg" 150 150 1430 351 0 6 
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\crt0mr.a30" 0 0 1596 539 0 5 
-"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 956 523 1 4 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\can.c" 0 0 1426 347 0 0 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\periph.c" 50 50 1430 351 0 2 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.c" 75 75 1430 351 0 3 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.h" 25 25 1430 351 0 1 
+"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\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 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
 [END]
Index: branch/duvernois/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/duvernois/Emb_App/SessionM32C_E8a_system.hsf	(revision 261)
+++ branch/duvernois/Emb_App/SessionM32C_E8a_system.hsf	(revision 262)
@@ -149,10 +149,10 @@
 "{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" "0000000000FF31F1" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF32FC" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A28" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000082C" 
+"{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_21" "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" "0000000000000004" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000220000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A28" 
+"{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_7" "0000000000000512" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
@@ -211,11 +211,17 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Global," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "rottourelle, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "rotroue, 1, 0, P, Col, Hex, MN" 
+"{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_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "5" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "valsaut, 1, 0, P, Col, Hex, 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}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -321,10 +327,7 @@
 "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\sys_rom.inc" 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.c" 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\periph.c" 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\radiocommande.h" 
-"E:\tp_info6_2018_duvernois\tp_info6\bsp\can.c" 
+"E:\tp_info6_2018_duvernois\tp_info6\Emb_App\Debug\mr308.inc" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -371,5 +374,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 89963592 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 94360416 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 261)
+++ branch/duvernois/Emb_App/programme_principal_etud.c	(revision 262)
@@ -131,6 +131,7 @@
 	int valsaut;
 	int Gainroue=1;
 	int consignevitesse=20;	
+	int Nump;
 
 void position ()
 {	
@@ -195,12 +196,47 @@
 	}
 }
 
+
 void saut()
+{                
+        //Tourelle periph[MAX_PERIPHS];
+        
+        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);
+        valsaut=periph[ADDR('C')].val; 
+        Gainroue=1;        
+        consignevitesse=20;        
+        
+        if (valsaut ==0x5603)
+        {
+                Gainroue=0;
+                consignevitesse=45;
+        }
+        if (valsaut ==0x4203)
+        {
+                Gainroue=1;
+                consignevitesse=15;        
+        }
+        comm.data.id='V';
+        comm.data.rtr=0;
+        comm.data.val=consignevitesse;
+        snd_dtq (CanTx,comm.msg);
+        dly_tsk(100);
+        }
+}
+
+void Piste()
 {		
-	//Tourelle periph[MAX_PERIPHS];
-	
-
-	CanFrame comm;
 	CanFrame demande;
 
 	UINT flag;
@@ -207,35 +243,18 @@
 	
 	while(1)
 	{	
-	demande.data.id='C'; 
+	demande.data.id='M'; 
 	demande.data.rtr=1;
-	periph[ADDR('C')].ev=0x01;
+	periph[ADDR('M')].ev=0x01;
 	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;	
-	
-	if (valsaut ==0x5603)
-	{
-		Gainroue=0;
-		consignevitesse=45;
+	Nump=periph[ADDR('M')].val; 
 	}
-	if (valsaut ==0x4203)
-	{
-		Gainroue=1;
-		consignevitesse=15;	
-	}
-
-	comm.data.id='V';
-	comm.data.rtr=0;
-	comm.data.val=consignevitesse;
-	snd_dtq (CanTx,comm.msg);
-	dly_tsk(100);
-	}
 }
 
+
+
 	
 void main()
 {
@@ -248,8 +267,10 @@
     clavier_init(1);
 	capture_init();
 
-	sta_cyc(ID_acqui);
+	sta_cyc(ID_acqui);
+	
 	sta_tsk(ID_periph_rx);
+	sta_tsk(ID_Piste);
 	sta_tsk(ID_tourelle);
 	dly_tsk(2000);
 	sta_tsk(ID_position);
Index: branch/duvernois/Emb_App/conf_noyau.cfg
===================================================================
--- branch/duvernois/Emb_App/conf_noyau.cfg	(revision 261)
+++ branch/duvernois/Emb_App/conf_noyau.cfg	(revision 262)
@@ -88,6 +88,15 @@
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
+task[]{
+	entry_address	= Piste();
+	name	= ID_Piste;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 1;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
 flag[]{
 	name	= ev_bus_fin_tr;
 	initial_pattern	= 0x0000;
