Index: branch/matteozzi/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/matteozzi/Emb_App/SessionM32C_E8a_system.ini	(revision 356)
+++ branch/matteozzi/Emb_App/SessionM32C_E8a_system.ini	(revision 357)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff001c
+RESET=ff002a
Index: branch/matteozzi/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/matteozzi/Emb_App/SessionM32C_E8a_system.hsf	(revision 356)
+++ branch/matteozzi/Emb_App/SessionM32C_E8a_system.hsf	(revision 357)
@@ -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" "000000000000FF01" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000064" 
 "{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,11 +149,11 @@
 "{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" "0000000000FF3063" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF32EE" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000B10" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000828" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "00000000000000FF" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000A54" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000858" 
+"{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" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_22" "0000000000000000" 
@@ -164,7 +164,7 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_27" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_28" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_29" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "0000000000000001" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_30" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_31" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_32" "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" "0000000000000B14" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000B1C" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000B24" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000007" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000120012" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000A54" 
 "{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" 
@@ -209,7 +209,9 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "ang_lu, 2, 0, P, Col, Dec, MA" 
 "{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}WatchWnd0ECX_WATCH_ITEM0002" "val_cap, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "3" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -312,10 +314,10 @@
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
 "E:\tp_info6_2018_matteozzi\tp_info6\Emb_App\programme_principal_etud.c" 
-"E:\tp_info6_2018_matteozzi\tp_info6\bsp\periph.c" 
 "E:\tp_info6_2018_matteozzi\tp_info6\Emb_App\crt0mr.a30" 
+"E:\tp_info6_2018_matteozzi\tp_info6\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_matteozzi\tp_info6\bsp\uart0.c" 
-"E:\tp_info6_2018_matteozzi\tp_info6\Emb_App\conf_noyau.cfg" 
+"E:\tp_info6_2018_matteozzi\tp_info6\bsp\periph.c" 
 "E:\tp_info6_2018_matteozzi\tp_info6\bsp\radiocommande.c" 
 "E:\tp_info6_2018_matteozzi\tp_info6\Emb_App\Debug\mr308.inc" 
 [TARGET_NAME]
@@ -364,5 +366,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 101862544 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 100128032 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/matteozzi/Emb_App/programme_principal_etud.c
===================================================================
--- branch/matteozzi/Emb_App/programme_principal_etud.c	(revision 356)
+++ branch/matteozzi/Emb_App/programme_principal_etud.c	(revision 357)
@@ -120,40 +120,47 @@
 //'I'/73/Ox49 : Définition du nom du véhicule. Doit débuter par le caractère '#' et entraine le chargement de la configuration de piste
 //				correspondant au nom du véhicule si le nom se termine par '*'
 
-unsigned short k1=6;
-unsigned short k2=2;
+unsigned short k1=7;
+unsigned short k2=1.99;
 unsigned short ang_lu=0;
-unsigned short ang_tourelle;
 CanFrame comm;
 CanFrame requete, reponse;
-unsigned short vitesse=0;
 unsigned short distance;
 unsigned short val_cap;
-unsigned short cons_angl=450;
-UINT flag;
+unsigned short vitesse;
+unsigned short distance_m;
+unsigned short cons_angl=400;
 
+
 ///////////////////////////
 //Declaration des taches///
 ///////////////////////////
 
-void capteur(){									//asservissement de l'angle de la tourelle
-	while(0){
-		requete.data.id='C';						//demande de la requete C	
-		requete.data.rtr=1;							//demande de lecture car rtr=1
-		snd_dtq(CanTx, requete.msg);				//envoie de la demande dans CanTx
-		val_cap=periph[ADDR('C')].val;				//recupere la valeur du capteur dans cal-cap  
+void capteur(){  
+	UINT flag;                                                                      //asservissement de l'angle de la tourelle
+    while(1){
+  	 	requete.data.id='C';                                                //demande de la requete C        
+   		requete.data.rtr=1;  
+		periph[ADDR('C')].ev=0x01;                                                      //demande de lecture car rtr=1
+		snd_dtq(CanTx, requete.msg);                                //envoie de la demande dans CanTx
+		dly_tsk(50);
+			
+		wai_flg(ev_periph, 0x01, TWF_ANDW, &flag);	//recoie la demande dans CanRx
+		val_cap=periph[ADDR('C')].val;                                //recupere la valeur du capteur dans val-cap 
 	}
-	dly_tsk(100);
 }
 
 
 void tourelle(){									//asservissement de l'angle de la tourelle
+//ang_lu 
+//cons_angl
+	UINT flag;
 	while(1){
 		requete.data.id='R';						//demande de la requete R	
 		requete.data.rtr=1;							//demande de lecture car rtr=1
 		periph[ADDR('R')].ev=0x01;
 		snd_dtq(CanTx, requete.msg);				//envoie de la demande dans CanTx
-		
+
 		wai_flg(ev_periph, 0x01, TWF_ANDW, &flag);	//recoie la demande dans CanRx
 		ang_lu=periph[ADDR('R')].val;				//recupere la valeur de l'angle dans retour   
 		
@@ -161,8 +168,8 @@
 		comm.data.rtr=0;							//commande d'ecriture car rtr=0
 		comm.data.val=k1*(cons_angl-ang_lu);
 		snd_dtq(CanTx, comm.msg);
+		dly_tsk(50);
 	}
-	dly_tsk(100);
 }
 
 void commande_vit(){					//commande de la vitesse   //TODO a ameliorer
@@ -171,80 +178,79 @@
 		comm.data.rtr=0;
 		comm.data.val=vitesse;
 		snd_dtq(CanTx, comm.msg);
-		if(val_cap==0x5603){
-			vitesse=60;
-			}
+		dly_tsk(50);
+		if(val_cap==0x6310){
+			comm.data.id='V';
+			comm.data.rtr=0;
+			comm.data.val=70;
+			snd_dtq(CanTx, comm.msg);
+			dly_tsk(260);
+			vitesse=30;
+		}
 	}
 }
 
 	
 void orient_roue(){
+	UINT flag;
 	while(1){
 		requete.data.id='U';
 		requete.data.rtr=1;
 		periph[ADDR('U')].ev=0x01;
 		snd_dtq(CanTx, requete.msg);
-		
+
 		wai_flg(ev_periph, 0x01, TWF_ANDW, &flag);	
 		distance=periph[ADDR('U')].val;				//recupere la valeur de l'angle dans retour  // amelioration de l asservissement
 		
-		if(distance>1500){
+		if(distance>1500 | val_cap==0x6310){
 			comm.data.id='D';							//demande de la requete D
-			comm.data.rtr=0;							//commande d'ecriture car rtr=0
+			comm.data.rtr=0;
 			comm.data.val=0;
 			snd_dtq(CanTx, comm.msg);
-			dly_tsk(700);
-			}
-		if(val_cap==0x5603){
-			comm.data.id='D';							//demande de la requete D
-			comm.data.rtr=0;							//commande d'ecriture car rtr=0
-			comm.data.val=0;
-			snd_dtq(CanTx, comm.msg);
-			dly_tsk(100000);
-			}
+			dly_tsk(50);
+			
+		}
+		
 		else{
 			comm.data.id='D';							//demande de la requete D
-			comm.data.rtr=0;							//commande d'ecriture car rtr=0
-			comm.data.val=k2*(distance-730);
+			comm.data.rtr=0;
+			distance_m=	(sin(40)*distance);				//commande d'ecriture car rtr=0
+			comm.data.val=k2*(distance_m-579);
 			snd_dtq(CanTx, comm.msg);
-			dly_tsk(100);
+			dly_tsk(50);
 		}
 	}
-	dly_tsk(200);
 }
 
 
 
 void main()
-{	
-	dly_tsk(50);
+{	
 	ports_mcu();
     lcd_init();
 	periph_init();
-	periph_nom("Titine");
-	dly_tsk(50);
+	periph_nom("#Titine*");
     can_init();
     clavier_init(1);
-	capture_init();
-	dly_tsk(50);
+	capture_init();
 	
 	sta_cyc(ID_acqui);
 	sta_tsk(ID_periph_rx);
 	sta_tsk(ID_tourelle);
 	sta_tsk(ID_orient_roue);
-	sta_tsk(ID_capteur);	
-	sta_tsk(ID_commande_vit);
-
-
+    sta_tsk(ID_capteur);  
+	sta_tsk(ID_vitesse);
+	
 	dly_tsk(1000);
 	vitesse=15;
-	dly_tsk(100);
+	dly_tsk(200);
 	vitesse=30;
     while(1)
-    {
-		LED_J=1;
-		LED_J=0;
-
+    {
+		LED_R=0;
+		dly_tsk(50);
+		LED_R=1;
+		dly_tsk(50);
 	}
 }
 
Index: branch/matteozzi/Emb_App/conf_noyau.cfg
===================================================================
--- branch/matteozzi/Emb_App/conf_noyau.cfg	(revision 356)
+++ branch/matteozzi/Emb_App/conf_noyau.cfg	(revision 357)
@@ -2,7 +2,7 @@
 //
 //    kernel.cfg : building file for MR308 Ver.4.00
 //
-//    Generated by M3T-MR308 GUI Configurator at 2018/12/14 17:27:45
+//    Generated by M3T-MR308 GUI Configurator at 2018/12/19 17:30:51
 //
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -73,7 +73,7 @@
 task[]{
 	entry_address	= orient_roue();
 	name	= ID_orient_roue;
-	stack_size	= 256;
+	stack_size	= 512;
 	stack_section	= stack;
 	priority	= 10;
 	initial_start	= OFF;
@@ -90,10 +90,10 @@
 };
 task[]{
 	entry_address	= commande_vit();
-	name	= ID_commande_vit;
+	name	= ID_vitesse;
 	stack_size	= 256;
 	stack_section	= stack;
-	priority	= 12;
+	priority	= 13;
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
Index: branch/matteozzi/Emb_App/conf_noyau.hcf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
