Index: branch/fichot/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/fichot/Emb_App/SessionM32C_E8a_system.ini	(revision 245)
+++ branch/fichot/Emb_App/SessionM32C_E8a_system.ini	(revision 246)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0016
+RESET=ff0018
Index: branch/fichot/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/fichot/Emb_App/SessionM32C_E8a_system.hsf	(revision 245)
+++ branch/fichot/Emb_App/SessionM32C_E8a_system.hsf	(revision 246)
@@ -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" "0000000000004044" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000120" 
+"{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_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" "0000000000FF057C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF3116" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000009B6" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "00000000000007F2" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000009FC" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000800" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "00000000000000C0" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000044" 
+"{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" 
 "{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" "0000000000000008" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "00000000000009E6" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000004" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000550055" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "00000000000009FC" 
 "{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,9 +205,11 @@
 "{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" "alpha, 10, 0, P, Col, Hex, N" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000" "distance, 10, 0, P, Col, Hex, N" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "1" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "angle, 10, 0, P, Col, Hex, N" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "2" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -277,7 +279,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" 
@@ -310,11 +312,12 @@
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
 "E:\tp_info6_2018_fichot\Emb_App\programme_principal_etud.c" 
+"E:\tp_info6_2018_fichot\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_fichot\Emb_App\crt0mr.a30" 
-"E:\tp_info6_2018_fichot\Emb_App\conf_noyau.cfg" 
-"E:\tp_info6_2018_fichot\bsp\carte_io.h" 
 "E:\tp_info6_2018_fichot\bsp\periph.c" 
 "E:\tp_info6_2018_fichot\bsp\carte_m32.h" 
+"E:\tp_info6_2018_fichot\bsp\clavier.c" 
+"E:\tp_info6_2018_fichot\bsp\carte_io.h" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -361,5 +364,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 89880264 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 92734744 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/fichot/Emb_App/programme_principal_etud.c
===================================================================
--- branch/fichot/Emb_App/programme_principal_etud.c	(revision 245)
+++ branch/fichot/Emb_App/programme_principal_etud.c	(revision 246)
@@ -121,20 +121,21 @@
 //				correspondant au nom du véhicule si le nom se termine par '*'
 
 
-int k=4;
-int vitesse = 40;
+int k=2;
+int k2=1;
+int vitesse = 10;
 
 
 
 CanFrame vit_roue; //canal de commande de la vitesse
 
-/*void demarrer()
+void demarrer()
 {
 	vit_roue.data.id='V'; 
 	vit_roue.data.rtr=0; 
 	vit_roue.data.val=vitesse;
 	snd_dtq (CanTx,vit_roue.msg);
-}*/
+}
 
 void asserv_tourelle()
 {
@@ -141,61 +142,47 @@
         CanFrame comm;
 		short angle;
 		CanFrame req, reponse;
-
-        
-		comm.data.id = 'T';
-        comm.data.rtr = 0;                                 
-        comm.data.val = 120;                        
-        
-		snd_dtq(CanTx, comm.msg);
-     	while(1){      
-        req.data.id = 'R';                                
-        req.data.rtr = 1;       
+                        
+       	while(1){      
+	        req.data.id = 'R';                                
+	        req.data.rtr = 1;       
+			
+			snd_dtq(CanTx, req.msg);
+                
+			angle = periph[ADDR('R')].val; //réponse de l'angle
 		
-		snd_dtq(CanTx, req.msg);
-        rcv_dtq(CanRx, &reponse.msg);
-        
-		angle = reponse.data.val;
-		
-		comm.data.id = 'T';                                                                
-        comm.data.rtr = 0;                                                                 
-        comm.data.val = k*(450 - angle);        
-        snd_dtq(CanTx, comm.msg);
+			comm.data.id = 'T';                                                                
+	        comm.data.rtr = 0;                                                                 
+	        comm.data.val = k*(450 - angle);        
+	        snd_dtq(CanTx, comm.msg);
+			dly_tsk(100);
 		}
 }
 
-short distance_telemetre(void){
-
-        CanFrame requete, reponse;
-        short distance;
-        requete.data.id = 'U';                                
-        requete.data.rtr = 1;
-		                                 
-        snd_dtq(CanTx, requete.msg);
-        rcv_dtq(CanRx, &reponse.msg);
+void asserv2()
+{
+        CanFrame comm;
+		CanFrame req, reponse;
+		unsigned short consigne = 770;
+		unsigned short distance;
+               
 		
-		return distance;
-}
-
-
-/*void asserv_roue(){
+     	while(1){
+	        req.data.id = 'U';                                
+	        req.data.rtr = 1;       
+		
+			snd_dtq(CanTx, req.msg);
+	        periph[ADDR('U')].val;
         
-		short dist;
-		const distance_au_centre = 719;
-		// avoir l'angle des roues
-		CanFrame comm;
-        comm.data.id = 'D';                               
-        comm.data.rtr = 0;                                 
-        comm.data.val = 0;                                
-        snd_dtq(CanTx, comm.msg); 
+			distance = periph[ADDR('U')].val; //réponse de distance
 		
-		// rester au centre
-		
-                                                                       
-        dist = distance_telemetre();
-        //if(dist > distance_au_centre)                 
-        
-}*/
+			comm.data.id = 'D';                                                                
+	        comm.data.rtr = 0;                                                                 
+	        comm.data.val = k2*(distance-consigne);        
+	        snd_dtq(CanTx, comm.msg);
+			dly_tsk(100);
+		}
+}
 
 void main()
 {        
@@ -206,10 +193,14 @@
     can_init();
     clavier_init(1);
     capture_init();
+	
+	sta_cyc(ID_acqui);
+	sta_tsk(ID_periph_rx);
 	sta_tsk(ID_asserv_tourelle);
-	//asserv_roue();
-	//demarrer();
+	sta_tsk(ID_asserv2);
+	dly_tsk(2000);
 	while(1){
+		demarrer();
         }
          
 }
Index: branch/fichot/Emb_App/conf_noyau.cfg
===================================================================
--- branch/fichot/Emb_App/conf_noyau.cfg	(revision 245)
+++ branch/fichot/Emb_App/conf_noyau.cfg	(revision 246)
@@ -2,7 +2,7 @@
 //
 //    kernel.cfg : building file for MR308 Ver.4.00
 //
-//    Generated by M3T-MR308 GUI Configurator at 2018/12/11 17:01:15
+//    Generated by M3T-MR308 GUI Configurator at 2018/12/14 14:41:44
 //
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -9,7 +9,7 @@
 // system definition
 system{
 	stack_size	= 256;
-	priority	= 9;
+	priority	= 10;
 	system_IPL	 = 4;
 	message_pri	 = 1;
 	timeout	 = YES;
@@ -20,7 +20,7 @@
 
 // max definition
 maxdefine{
-	max_task	= 4;
+	max_task	= 5;
 	max_flag	= 3;
 	max_dtq	= 2;
 	max_cyh	= 1;
@@ -70,6 +70,15 @@
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
+task[]{
+	entry_address	= asserv2();
+	name	= ID_asserv2;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 10;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
 
 flag[]{
 	name	= ev_bus_fin_tr;
Index: branch/fichot/Emb_App/conf_noyau.hcf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branch/fichot/Emb_App/EmbM32C87App.tps
===================================================================
--- branch/fichot/Emb_App/EmbM32C87App.tps	(revision 245)
+++ branch/fichot/Emb_App/EmbM32C87App.tps	(revision 246)
@@ -18,7 +18,7 @@
 "SessionM32C_E8a_system" 
 [GENERAL_DATA_PROJECT]
 [GENERAL_DATA_CONFIGURATION_Debug]
-"PROJECT_FILES_MODIFIED_DATA_TAG" "FALSE" 
+"PROJECT_FILES_MODIFIED_DATA_TAG" "TRUE" 
 [SESSIONS_Debug]
 "DefaultSession" 
 "SessionM32C_E8a_system" 
