Index: branch/colomban/Emb_App.tws
===================================================================
--- branch/colomban/Emb_App.tws	(revision 489)
+++ branch/colomban/Emb_App.tws	(revision 490)
@@ -7,15 +7,19 @@
 [GENERAL_DATA]
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
+"E:\tp_info6_2018_colomban\tp_info6\bsp\lcd.c" 
 "E:\tp_info6_2018_colomban\tp_info6\bsp\periph.c" 
 "E:\tp_info6_2018_colomban\tp_info6\bsp\uart0.c" 
+"E:\tp_info6_2018_colomban\tp_info6\Emb_App\conf_noyau.cfg" 
 "E:\tp_info6_2018_colomban\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_colomban\tp_info6\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_colomban\tp_info6\Emb_App\programme_principal_etud.c" 
 [WORKSPACE_FILE_STATES]
 "E:\tp_info6_2018_colomban\tp_info6\Emb_App\Debug\mr308.inc" 75 75 1430 351 0 3 
-"E:\tp_info6_2018_colomban\tp_info6\Emb_App\crt0mr.a30" -8 -30 1596 539 1 1 
+"E:\tp_info6_2018_colomban\tp_info6\Emb_App\conf_noyau.cfg" 125 125 1430 351 0 5 
+"E:\tp_info6_2018_colomban\tp_info6\Emb_App\crt0mr.a30" 0 0 1596 539 0 1 
 "E:\tp_info6_2018_colomban\tp_info6\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 0 
+"E:\tp_info6_2018_colomban\tp_info6\bsp\lcd.c" -8 -30 1596 539 1 6 
 "E:\tp_info6_2018_colomban\tp_info6\bsp\periph.c" 100 100 1430 351 0 4 
 "E:\tp_info6_2018_colomban\tp_info6\bsp\uart0.c" 50 50 1430 351 0 2 
 [LOADED_PROJECTS]
Index: branch/colomban/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/colomban/Emb_App/SessionM32C_E8a_system.ini	(revision 489)
+++ branch/colomban/Emb_App/SessionM32C_E8a_system.ini	(revision 490)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0022
+RESET=ff007a
Index: branch/colomban/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/colomban/Emb_App/SessionM32C_E8a_system.hsf	(revision 489)
+++ branch/colomban/Emb_App/SessionM32C_E8a_system.hsf	(revision 490)
@@ -196,8 +196,8 @@
 "{55384715-F881-421C-A548-D7D1ABE158E1}PDMRWndInstanceKey1" "{WK_00000001_PDMR}EmbM32C87AppSessionM32C_E8a_system0" 
 "{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" "0000000000000020" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000001770" 
+"{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" 
@@ -204,12 +204,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" "0000000000FF058C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF2DAC" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "0000000000000B16" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000850" 
-"{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_18" "0000000000001158" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000086E" 
+"{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" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_23" "0000000000000000" 
@@ -219,7 +219,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" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_3" "0000000000000001" 
 "{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" 
@@ -226,9 +226,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" "000000000000000A" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000000" 
-"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000B4C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000000002" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000000630" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000115E" 
 "{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" 
@@ -266,7 +266,13 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Global," 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002" "cpt, 2, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0002_SCOPE" "Global," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "3" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "piste, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "pistes, 2, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "tps, 2, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "6" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth0" "120" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth1" "150" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd1ColWidth12" "200" 
@@ -369,11 +375,13 @@
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"E:\tp_info6_2018_colomban\tp_info6\bsp\lcd.c" 
 "E:\tp_info6_2018_colomban\tp_info6\Emb_App\crt0mr.a30" 
 "E:\tp_info6_2018_colomban\tp_info6\Emb_App\programme_principal_etud.c" 
+"E:\tp_info6_2018_colomban\tp_info6\Emb_App\Debug\mr308.inc" 
 "E:\tp_info6_2018_colomban\tp_info6\bsp\uart0.c" 
 "E:\tp_info6_2018_colomban\tp_info6\bsp\periph.c" 
-"E:\tp_info6_2018_colomban\tp_info6\Emb_App\Debug\mr308.inc" 
+"E:\tp_info6_2018_colomban\tp_info6\Emb_App\conf_noyau.cfg" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -420,5 +428,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 92919704 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 79743160 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/colomban/Emb_App/programme_principal_etud.c
===================================================================
--- branch/colomban/Emb_App/programme_principal_etud.c	(revision 489)
+++ branch/colomban/Emb_App/programme_principal_etud.c	(revision 490)
@@ -121,7 +121,11 @@
 //				correspondant au nom du véhicule si le nom se termine par '*'
 
 unsigned short      alpha ;
+unsigned short      piste ;
+unsigned short      pistes;
+unsigned short      zone;
 unsigned short      dist ;
+unsigned long       tps ;
 unsigned short      k=5; //pour augmenter la vitesse jusqu'a la position souhaitée
 unsigned short      ka=1;
 unsigned short 		cpt;
@@ -148,6 +152,7 @@
 
 	sta_cyc(ID_acqui);
 	sta_tsk(ID_periph_rx);
+	sta_tsk(ID_lcd);
 	sta_tsk(ID_asserv);
 	sta_tsk(ID_roue);
 	sta_tsk(ID_capteur);
@@ -195,11 +200,36 @@
 
 void vitesse(){
 		while(1){
+				req.data.id = 'M';
+				req.data.rtr = 1;
+				periph[ADDR('R')].ev=0X01;
+				snd_dtq(CanTx, req.msg);
+		
+				wai_flg(ev_periph,0X01,TWF_ANDW, &flag);
+				piste=periph[ADDR('M')].val;
+				pistes = piste & 0x0F;
+				zone = piste & 0xF0;
+			if(pistes == 0x0001 || pistes == 0x0002){
 			comm.data.id = 'V';
 			comm.data.rtr = 0;
+            comm.data.val = 30;
+			snd_dtq(CanTx, comm.msg);
+			dly_tsk(7);
+			}
+			if(pistes == 0x0003 ){
+			comm.data.id = 'V';
+			comm.data.rtr = 0;
+            comm.data.val = 25;
+			snd_dtq(CanTx, comm.msg);
+			dly_tsk(7);
+			}
+			if(pistes == 0x0004){
+			comm.data.id = 'V';
+			comm.data.rtr = 0;
             comm.data.val = 15;
 			snd_dtq(CanTx, comm.msg);
 			dly_tsk(7);
+			}
 		}
 	}	
 
@@ -212,23 +242,33 @@
 			snd_dtq(CanTx, req.msg);
 			wai_flg(ev_periph,0X01,TWF_ANDW, &flag);
 			dist=periph[ADDR('U')].val;
-			        if(dist>1200 || dist <400){
+		   
+				if(dist>1200){
+				
+			       
 					comm.data.id = 'D';
 					comm.data.rtr = 0;
 					comm.data.val = 0;
 					snd_dtq(CanTx, comm.msg);
 					dly_tsk(10);
-				
-				}
-				
-				
-			else{
+					}
+				else{
 				comm.data.id = 'D';
 				comm.data.rtr = 0;
 				comm.data.val = ka*(-consignes + dist);
 				snd_dtq(CanTx, comm.msg);
 				dly_tsk(7);
-			}
+				}
+				
+				if(dist<400  && pistes == 0x0004){							       
+					comm.data.id = 'D';
+					comm.data.rtr = 0;
+					comm.data.val = 0;
+					snd_dtq(CanTx, comm.msg);
+					dly_tsk(10);
+					}
+						
+		
 		}		
 	}
 
@@ -247,7 +287,7 @@
 				sus_tsk(ID_vitesse);
 				comm.data.id = 'V';
 				comm.data.rtr = 0;
-	            comm.data.val = 50;
+	            comm.data.val = 49;
 				snd_dtq(CanTx, comm.msg);
 				dly_tsk(7);
 				}
@@ -324,21 +364,15 @@
 				dly_tsk(7);
 				}
 			if(cpt==0x7607){
-				comm.data.id = 'V';
-				comm.data.rtr = 0;
-	            comm.data.val = 11;
-				snd_dtq(CanTx, comm.msg);
-				dly_tsk(14);
+				dly_tsk(15);
 				rsm_tsk(ID_roue);
 				rsm_tsk(ID_vitesse);
 				dly_tsk(7);
 				}
 			
-				if(cpt==0x7608){
-				consignes = 950;
-				}	
-				dly_tsk(7);
-			if(cpt==0x7609){
+				
+				
+			if(cpt==0x7608){
 				sus_tsk(ID_vitesse);
 				comm.data.id = 'V';
 				comm.data.rtr = 0;
@@ -346,9 +380,45 @@
 				snd_dtq(CanTx, comm.msg);
 				dly_tsk(7);
 				}	
-						
+			if(cpt==0x7609){
+				rsm_tsk(ID_vitesse);
+				dly_tsk(7);
+				}			
 					
 			
 			}				
 	}
 	 
+void lcd(){
+		while(1){
+			lcd_init();
+			req.data.id = 'H';
+			req.data.rtr = 1;
+			periph[ADDR('H')].ev=0X01;
+			snd_dtq(CanTx, req.msg);
+			wai_flg(ev_periph,0X01,TWF_ANDW, &flag);
+			tps = periph[ADDR('H')].val; 
+
+			
+			switch(pistes){
+				case(0x0001) : lcd_str("vert = " ); break ;
+				case(0x0002) : lcd_str("bleu = "); break ;
+				case(0x0003) : lcd_str("rouge ="); break ;
+				case(0x0004) : lcd_str("noire ="); break ;
+				
+				dly_tsk(7);
+				}
+			
+			switch(zone){
+				case(0x5600) : lcd_str("zone verte" ); break ;
+				case(0x4300) : lcd_str("zone bleu "); break ;
+				case(0x4a00) : lcd_str("zone jaune "); break ;
+				case(0x5200) : lcd_str("zone rouge "); break ;
+				case(0x4200) : lcd_str("zone cyan "); break ;
+				
+				dly_tsk(7);
+				}
+			
+			}
+	
+	}
\ No newline at end of file
Index: branch/colomban/Emb_App/conf_noyau.cfg
===================================================================
--- branch/colomban/Emb_App/conf_noyau.cfg	(revision 489)
+++ branch/colomban/Emb_App/conf_noyau.cfg	(revision 490)
@@ -2,7 +2,7 @@
 //
 //    kernel.cfg : building file for MR308 Ver.4.00
 //
-//    Generated by M3T-MR308 GUI Configurator at 2018/12/19 13:36:15
+//    Generated by M3T-MR308 GUI Configurator at 2019/01/14 14:02:06
 //
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -9,7 +9,7 @@
 // system definition
 system{
 	stack_size	= 256;
-	priority	= 10;
+	priority	= 11;
 	system_IPL	 = 4;
 	message_pri	 = 1;
 	timeout	 = YES;
@@ -20,7 +20,7 @@
 
 // max definition
 maxdefine{
-	max_task	= 7;
+	max_task	= 8;
 	max_flag	= 3;
 	max_dtq	= 2;
 	max_cyh	= 1;
@@ -97,6 +97,15 @@
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
+task[]{
+	entry_address	= lcd();
+	name	= ID_lcd;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 11;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
 
 flag[]{
 	name	= ev_bus_fin_tr;
Index: branch/colomban/Emb_App/conf_noyau.hcf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: branch/colomban/bsp/lcd.c
===================================================================
--- branch/colomban/bsp/lcd.c	(revision 489)
+++ branch/colomban/bsp/lcd.c	(revision 490)
@@ -120,5 +120,5 @@
 {
 int i;
 
-	for  (i=0;i<n*60;i++);
+for  (i=0;i<n*60;i++);
 }
\ No newline at end of file
