Index: branch/mbaye/Emb_App.tws
===================================================================
--- branch/mbaye/Emb_App.tws	(revision 383)
+++ branch/mbaye/Emb_App.tws	(revision 384)
@@ -12,8 +12,8 @@
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 0 474 160 38 0 0 
-"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" 150 150 1430 351 0 2 
-"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" -8 -30 1596 539 1 1 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" -8 -30 1596 539 1 2 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 1 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
 [END]
Index: branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf	(revision 383)
+++ branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf	(revision 384)
@@ -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" "0000000000FF0572" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0582" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "000000000000140E" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000083E" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000001410" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000840" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000001" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000044" 
+"{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" 
@@ -173,7 +173,7 @@
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "000000000000000B" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000143A" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000143C" 
 "{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,11 +209,11 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0000_SCOPE" "Current Scope," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001" "pos, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "capt, 1, 0, P, Col, Bin, MN" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "capt, 1, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "a, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "dist, 1, 0, P, Col, Dec, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "3" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "4" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -284,7 +284,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 -4 -30 948 486 9 0 "" "0.0" 
+"{WK_00000001_DISASSEMBLY}" "WINDOW" 0 0 0 "0.00" 0 75 75 1430 351 10 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.35" 365 0 0 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
@@ -315,9 +315,10 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 
 "E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 
-"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\Debug\Disassembly" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -364,5 +365,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 92926504 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 93912192 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/mbaye/Emb_App/programme_principal_etud.c
===================================================================
--- branch/mbaye/Emb_App/programme_principal_etud.c	(revision 383)
+++ branch/mbaye/Emb_App/programme_principal_etud.c	(revision 384)
@@ -142,7 +142,7 @@
 	  // dly_tsk(100);
 	
 	   comm.data.id='T'; comm.data.rtr=0; 
-	   comm.data.val=1.5*(585-pos);
+	   comm.data.val=1.0*(585-pos);
 	   snd_dtq (CanTx,comm.msg);
 	   dly_tsk(100);
 	}
@@ -164,6 +164,16 @@
 	   {
 		   comm.data.val=0;
 	       snd_dtq (CanTx,comm.msg);
+		    if (dis>585) 
+	        {
+		      dis = 585;
+	       }
+		    else
+	        {
+			  dis = periph[ADDR('U')].val;
+	          comm.data.val=-1.5*(585-dis);
+	          snd_dtq (CanTx,comm.msg);
+	        }
 	   }
 	   else
 	   {
@@ -170,6 +180,7 @@
 	       comm.data.val=-1.5*(585-dis);
 	       snd_dtq (CanTx,comm.msg);
 	   }
+	   
 	    //dly_tsk(100);
 	}
 }
