Index: branch/duvernois/Emb_App/SessionM32C_E8a_system.ini
===================================================================
--- branch/duvernois/Emb_App/SessionM32C_E8a_system.ini	(revision 458)
+++ branch/duvernois/Emb_App/SessionM32C_E8a_system.ini	(revision 459)
@@ -25,4 +25,4 @@
 [Target]
 M32C E8a SYSTEM=Renesas Communications
 [USER_DATA]
-RESET=ff0020
+RESET=ff0022
Index: branch/duvernois/Emb_App/programme_principal_etud.c
===================================================================
--- branch/duvernois/Emb_App/programme_principal_etud.c	(revision 458)
+++ branch/duvernois/Emb_App/programme_principal_etud.c	(revision 459)
@@ -139,9 +139,9 @@
 	int rotroue;
 	
 	int mask= 0x00FF;	
-	int maskdepart= 0x7FFF;
-	int Go;
-	
+	int maskdepart= 0x8000;
+	unsigned int Go;
+	int cpt=0;
 		
 void position ()
 {	
@@ -167,6 +167,7 @@
 		{
 		comm.data.id='D'; comm.data.rtr=0; comm.data.val=rotroue;
 		snd_dtq (CanTx,comm.msg);
+		
 		}
 	else
 		{
@@ -173,8 +174,8 @@
 		comm.data.id='D'; comm.data.rtr=0; comm.data.val=0;
 		snd_dtq (CanTx,comm.msg);
 		}
-	LED_J=!LED_J;
-	dly_tsk(25);		
+
+	dly_tsk(20);		
 	}
 }
 
@@ -203,7 +204,7 @@
 	rottourelle=(consignetourelle-alpha);
 	comm.data.id='T'; comm.data.rtr=0; comm.data.val=rottourelle;
 	snd_dtq (CanTx,comm.msg);
-	dly_tsk(100);
+	dly_tsk(50);
 	}
 }
 
@@ -229,15 +230,15 @@
         
         if (valcapt ==0x5603)
         {
-              	Gainroue =0;
+              	consignetele=40; 
                 Valvitesse=45;
-				LED_V=!LED_V;
+				
         }
        else if (valcapt ==0x4203)
         {
                 Valvitesse=10;  
-				Gainroue=1;     
-				LED_V=!LED_V; 
+				consignetele=400;     
+			 
         }
 		else
 		{
@@ -244,7 +245,7 @@
 		Valvitesse=20; 
 		}
 
-		dly_tsk(100);
+		dly_tsk(50);
 		}
 }
 
@@ -267,6 +268,21 @@
 	Go=(Valpiste & maskdepart);
 }
 
+
+void LEDJ()
+{		
+	if (var <= 0 && var >= 2000)
+	{
+		LED_J=1;
+	}
+	else
+	{
+		LED_J=0;
+	}
+	dly_tsk(1000);
+	
+}
+
 void noir()
 {                        
         CanFrame comm;
@@ -286,7 +302,7 @@
         if (valcapt ==0x5601)
         {
             consigneposition= 900;  
-			Valvitesse=25; 
+			Valvitesse=20; 
 			consignetele=300;
         }
        else if (valcapt ==0x4a01)
@@ -297,7 +313,7 @@
         }
 		else if (valcapt ==0x5602)
         {
-			consignetele=50;  
+			consignetele=40;  
         }
 		else if (valcapt ==0x5202)
         {
@@ -306,8 +322,8 @@
         }
 		else if (valcapt ==0x5603)
         {
-			Valvitesse=42;
-			consignetele=40;    
+			Valvitesse=43;
+			consignetele=20;    
         }
        	else if (valcapt ==0x4203)
         {
@@ -319,12 +335,9 @@
 			Valvitesse=25;
 			consigneposition= 850;   
 			consignetele=300;
+        }	   
+		dly_tsk(20);
         }
-	  
-	   
-	   
-		dly_tsk(40);
-        }
 }
 
 
@@ -334,16 +347,47 @@
 	
 	while(1)
 	{
+	
 	consignevitesse=Valvitesse; 
 	comm.data.id='V';
 	comm.data.rtr=0; 
 	comm.data.val=consignevitesse;
 	snd_dtq (CanTx,comm.msg);
-	dly_tsk(100);
-	}
 	
 
+	dly_tsk(200);
+	
+	
+	}	
+
 }	
+
+
+void Depart()
+{		
+	CanFrame demande;
+
+	UINT flag;
+	
+	while(1)
+	{
+	if (Go!=32768)
+	{	
+	demande.data.id='M'; 
+	demande.data.rtr=1;
+	periph[ADDR('M')].ev=0x01;
+	snd_dtq(CanTx,demande.msg);	
+		dly_tsk(10);	
+	wai_flg(ev_periph,0x01,TWF_ANDW, &flag);
+	Valpiste=(periph[ADDR('M')]).val; 
+	Go=(Valpiste & maskdepart);
+	}    		
+	dly_tsk(200);
+	
+	}	
+			
+}
+
 void main()
 {
 	ports_mcu();
@@ -358,14 +402,14 @@
 	sta_cyc(ID_acqui);
 	
 	sta_tsk(ID_periph_rx);
-	
+	sta_tsk(ID_Depart);
 	sta_tsk(ID_Piste);
 	dly_tsk(1000);
 			
 	if (Nump == 1 || Nump == 5)
 	{
-		Valvitesse=30;
-		consignetele=600;
+		Valvitesse=45;
+		consignetele=1200;
 		consigneposition = 715;
 	}
 	if (Nump == 2 || Nump == 6)
@@ -388,15 +432,18 @@
 	dly_tsk(2000);	
 	sta_tsk(ID_tourelle);
 	sta_tsk(ID_position);
+	sta_tsk(ID_LEDJ);
 	dly_tsk(2000);
-	while(Go==1)
+	LED_R=1;	
+	while(Go==32768)
 		{
-		sta_tsk(ID_vitesse);
-		}
+		sta_tsk(ID_vitesse);
+		LED_V=1;
+	
+		}	
     while(1)
     {
-
-					
+			
 	dly_tsk(100);
 		
 		
@@ -405,6 +452,6 @@
 
 void acqui()
 {
- LED_R=!LED_R;
+ 
 }
 
Index: branch/duvernois/Emb_App/conf_noyau.cfg
===================================================================
--- branch/duvernois/Emb_App/conf_noyau.cfg	(revision 458)
+++ branch/duvernois/Emb_App/conf_noyau.cfg	(revision 459)
@@ -48,7 +48,7 @@
 	name	= ID_periph_tx;
 	stack_size	= 256;
 	stack_section	= stack;
-	priority	= 3;
+	priority	= 4;
 	initial_start	= ON;
 	exinf	= 0x0;
 };
@@ -57,7 +57,7 @@
 	name	= ID_periph_rx;
 	stack_size	= 256;
 	stack_section	= stack;
-	priority	= 2;
+	priority	= 3;
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
@@ -84,7 +84,7 @@
 	name	= ID_saut;
 	stack_size	= 256;
 	stack_section	= stack;
-	priority	= 2;
+	priority	= 3;
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
@@ -111,10 +111,28 @@
 	name	= ID_noir;
 	stack_size	= 256;
 	stack_section	= stack;
+	priority	= 3;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
+task[]{
+	entry_address	= Depart();
+	name	= ID_Depart;
+	stack_size	= 256;
+	stack_section	= stack;
 	priority	= 2;
 	initial_start	= OFF;
 	exinf	= 0x0;
 };
+task[]{
+	entry_address	= LEDJ();
+	name	= ID_LEDJ;
+	stack_size	= 256;
+	stack_section	= stack;
+	priority	= 1;
+	initial_start	= OFF;
+	exinf	= 0x0;
+};
 flag[]{
 	name	= ev_bus_fin_tr;
 	initial_pattern	= 0x0000;
