Index: branch/zhang/Emb_App.tws
===================================================================
--- branch/zhang/Emb_App.tws	(revision 214)
+++ branch/zhang/Emb_App.tws	(revision 215)
@@ -7,19 +7,23 @@
 [GENERAL_DATA]
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
-"C:\Program Files (x86)\Renesas\Hew\Tools\Renesas\nc308wa\v542r00\inc308\stdlib.h" 
 "E:\tp_info6_zhan\bsp\lcd.c" 
+"E:\tp_info6_zhan\bsp\periph.c" 
+"E:\tp_info6_zhan\bsp\uart0.c" 
 "E:\tp_info6_zhan\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_zhan\Emb_App\crt0mr.a30" 
 "E:\tp_info6_zhan\Emb_App\Debug\kernel_id.h" 
+"E:\tp_info6_zhan\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_zhan\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
-"C:\Program Files (x86)\Renesas\Hew\Tools\Renesas\nc308wa\v542r00\inc308\stdlib.h" 150 150 1430 351 0 6 
-"E:\tp_info6_zhan\Emb_App\Debug\kernel_id.h" 75 75 1430 351 0 5 
-"E:\tp_info6_zhan\Emb_App\conf_noyau.cfg" 25 25 1430 351 0 4 
-"E:\tp_info6_zhan\Emb_App\crt0mr.a30" 125 125 1426 347 0 1 
-"E:\tp_info6_zhan\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 2 
-"E:\tp_info6_zhan\bsp\lcd.c" -8 -30 1596 539 1 3 
+"E:\tp_info6_zhan\Emb_App\Debug\kernel_id.h" 50 50 1430 351 0 2 
+"E:\tp_info6_zhan\Emb_App\Debug\mr308.inc" 125 125 1430 351 0 5 
+"E:\tp_info6_zhan\Emb_App\conf_noyau.cfg" 75 75 1430 351 0 3 
+"E:\tp_info6_zhan\Emb_App\crt0mr.a30" 25 25 1430 351 0 1 
+"E:\tp_info6_zhan\Emb_App\programme_principal_etud.c" -8 -30 1596 539 1 0 
+"E:\tp_info6_zhan\bsp\lcd.c" 100 100 1430 351 0 4 
+"E:\tp_info6_zhan\bsp\periph.c" 0 0 1430 351 0 7 
+"E:\tp_info6_zhan\bsp\uart0.c" 150 150 1430 351 0 6 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
 [END]
Index: branch/zhang/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/zhang/Emb_App/SessionM32C_E8a_system.hsf	(revision 214)
+++ branch/zhang/Emb_App/SessionM32C_E8a_system.hsf	(revision 215)
@@ -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" "0000000000000258" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_1" "0000000000000001" 
+"{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" "0000000000FF2FBF" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0678" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000001466" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000BCE" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "00000000000000C8" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000E66" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000B9E" 
+"{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" "00000000000014A4" 
+"{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" "000000000000146C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000E9A" 
 "{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" 
@@ -278,7 +278,7 @@
 [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.07" 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 50 50 1430 351 10 0 "" "0.0" 
+"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 -8 -30 1596 539 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" 
 "{WK_00000001_OUTPUT}" "WINDOW" 59422 0 2 "0.52" 365 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
@@ -309,13 +309,14 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"E:\tp_info6_zhan\Emb_App\programme_principal_etud.c" 
+"E:\tp_info6_zhan\Emb_App\crt0mr.a30" 
+"E:\tp_info6_zhan\bsp\periph.c" 
 "E:\tp_info6_zhan\bsp\lcd.c" 
-"E:\tp_info6_zhan\Emb_App\crt0mr.a30" 
-"C:\Program Files (x86)\Renesas\Hew\Tools\Renesas\nc308wa\v542r00\inc308\stdlib.h" 
-"E:\tp_info6_zhan\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_zhan\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_zhan\Emb_App\Debug\kernel_id.h" 
-"E:\tp_info6_zhan\Disassembly" 
+"E:\tp_info6_zhan\bsp\uart0.c" 
+"E:\tp_info6_zhan\Emb_App\Debug\mr308.inc" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -362,5 +363,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 91677544 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 88790952 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/zhang/Emb_App/programme_principal_etud.c
===================================================================
--- branch/zhang/Emb_App/programme_principal_etud.c	(revision 214)
+++ branch/zhang/Emb_App/programme_principal_etud.c	(revision 215)
@@ -178,7 +178,7 @@
 	// et commande la vitesse de tourelle(asservissement)
 	CanFrame requete, reponse, comm; 
 	FLGPTN flag;
-	int a;
+	unsigned int a;
 	while(1){	
 //	slp_tsk();
 	requete.data.id = 'R';			// angle de tourelle
@@ -191,10 +191,7 @@
 //	alpha = reponse.data.val;       //le val de angle de tourelle
 	
 	wai_flg (ev_periph,0x01,TWF_ANDW,&flag);   //wait reponse
-	alpha = periph[ADDR('R')].val;
-	
-	
-	
+	alpha = periph[ADDR('R')].val;	
 
 	a = ad00 - alpha;			// vitesse = consigne - position	
 	if(alpha > 900 ) a = 0;        // alpha >90° stop move
@@ -209,6 +206,9 @@
 	CanFrame requete, reponse, comm;
 	FLGPTN flag;
 
+	unsigned int c;
+
+
 	while(1){	
 	requete.data.id = 'U';
 	requete.data.rtr = 1;			//indique une requête de lecture
@@ -217,17 +217,17 @@
 	
 //	rcv_dtq(CanRx, &reponse.msg);
 //	distance = reponse.data.val;
-
-	
-
 	wai_flg (ev_periph,0x02,TWF_ANDW,&flag);
 	distance = periph[ADDR('U')].val;
 	
+//	if( distance > 1850 & distance < 2150) c = 0;
+	c = -0.2 *( distance-1600 );
 
 	comm.data.id = 'D';
 	comm.data.rtr = 0;
-	comm.data.val = ? -distance;
+	comm.data.val = c;
 	snd_dtq(CanTx, comm.msg);
+//	dly_tsk(10);
 	}
 }
 
@@ -245,7 +245,7 @@
 
 	comm.data.id = 'V';
 	comm.data.rtr = 0;
-	comm.data.val = 10;
+	comm.data.val = 5;
 	snd_dtq(CanTx, comm.msg);
 	}
 }
