Index: branch/mbaye/Emb_App.tws
===================================================================
--- branch/mbaye/Emb_App.tws	(revision 406)
+++ branch/mbaye/Emb_App.tws	(revision 407)
@@ -7,13 +7,17 @@
 [GENERAL_DATA]
 [BREAKPOINTS]
 [OPEN_WORKSPACE_FILES]
+"E:\tp_info6_2018_mbaye\tp_info6\bsp\can.c" 
+"E:\tp_info6_2018_mbaye\tp_info6\bsp\uart0.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\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" -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 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\conf_noyau.cfg" 0 474 160 38 0 1 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\crt0mr.a30" -8 -30 1596 539 1 3 
+"E:\tp_info6_2018_mbaye\tp_info6\Emb_App\programme_principal_etud.c" 0 0 1596 539 0 2 
+"E:\tp_info6_2018_mbaye\tp_info6\bsp\can.c" 125 125 1430 351 0 5 
+"E:\tp_info6_2018_mbaye\tp_info6\bsp\uart0.c" 100 100 1430 351 0 4 
 [LOADED_PROJECTS]
 "EmbM32C87App" 
 [END]
Index: branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf
===================================================================
--- branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf	(revision 406)
+++ branch/mbaye/Emb_App/SessionM32C_E8a_system.hsf	(revision 407)
@@ -141,7 +141,7 @@
 "{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" "0000000000004044" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_0" "0000000000000044" 
 "{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" 
@@ -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" "0000000000FF0582" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FF0573" 
 "{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFF800" 
-"{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_18" "000000000000163E" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "000000000000086E" 
 "{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_20" "0000000000000044" 
 "{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" "000000000000143C" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "000000000000166A" 
 "{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" 
@@ -211,9 +211,13 @@
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0001_SCOPE" "Current Scope," 
 "{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" "dist, 1, 0, P, Col, Dec, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003" "info_piste, 1, 0, P, Col, Hex, MA" 
 "{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0003_SCOPE" "Current Scope," 
-"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEMCnt" "4" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004" "numero_p, 1, 0, P, Col, Hex, MA" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0004_SCOPE" "Current Scope," 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWnd0ECX_WATCH_ITEM0005" "feu, 1, 0, P, Col, Hex, 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" 
@@ -318,7 +322,9 @@
 "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\Debug\Disassembly" 
+"E:\tp_info6_2018_mbaye\tp_info6\bsp\uart0.c" 
+"E:\tp_info6_2018_mbaye\tp_info6\bsp\can.c" 
+"E:\tp_info6_2018_mbaye\tp_info6\Disassembly" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -365,5 +371,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 93912192 1 "{00000000-0000-0000-C000-000000000046}" "" 
+"d:\profs\tp_info14_travail\tp_info14\emb_app\programme_principal_etud.c" 95 75247360 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 406)
+++ branch/mbaye/Emb_App/programme_principal_etud.c	(revision 407)
@@ -306,15 +306,17 @@
 		{
 		  if(capt==0x5603)
 		  {
-	        commv.data.val=60;
+	        commv.data.val=48;
 	        snd_dtq (CanTx,commv.msg);
-			//dly_tsk(4000);
-			//commv.data.val=15;
-	        //snd_dtq (CanTx,commv.msg);
 	 	  }
+		 else if(capt==0x0002)
+		  {
+	        commv.data.val=12;
+	        snd_dtq (CanTx,commv.msg);
+		  }
 		  else
 		  {
-		    commv.data.val=10;
+		    commv.data.val=12;
 	        snd_dtq (CanTx,commv.msg);	
 		  }
 	     }
@@ -358,7 +360,82 @@
 			sta_tsk(ID_vitesse_roue);
 		}
 	}
-}
+}
+
+unsigned long Puiss10 (char indice)
+{
+        int i; 
+        unsigned long puiss = 1;
+        for(i=0;i<indice;i++)
+        {
+                puiss = puiss * 10;
+        }
+        return puiss;        
+}
+unsigned int decode_int(char *chaine){
+ unsigned int  nombre=0;
+ int entier[10]={0};
+ int i=0,j = 0, n = 0;
+ if(chaine[i] != '#') return -1;
+ i=1;
+  while(chaine[i] != '*')
+    {                
+                if('0'>chaine[i] && chaine[i]>'9') return -1;
+                entier[i-1] = chaine[i] - '0';
+                i++;
+        }
+        for(j=0;j<i-1;j++)
+        {
+         nombre = nombre + entier[j]*Puiss10(i-2-j);        
+        }
+        return nombre;
+   
+ /*if(chaine[i]='#'){
+  
+  i++;
+  c=chaine[i];
+  while(c!='*'){ 
+   if(c<=57 && c>=48){
+    nombre=(nombre*10)+(c-48);     
+   }
+   i++;
+   return nombre;
+  }  
+ }
+ else{
+  return -1;
+ }*/
+}
+void clavier() 
+{
+ char sequence[10]={0};
+ short code_touche;
+ int index = 1;
+        while(1) 
+        {
+          vrcv_dtq(QdmTouche, &code_touche);
+            lcd_putc(code_touche);
+                while(code_touche != '*')
+             {                
+                   if(code_touche == '#')
+                    {
+                      sequence[0] = code_touche; 
+                    } 
+                    else
+     {
+                     sequence[index] = code_touche;
+                        index++;
+                     }
+                     vrcv_dtq(QdmTouche, &code_touche);
+                     lcd_putc(code_touche);
+                }
+        sequence[index] = '*';
+        //consigne_tour = decode_int(sequence);
+        index=1;
+        dly_tsk(200);
+        }
+}
+
 void main()
 {
 	ports_mcu();
@@ -380,7 +457,7 @@
 	sta_tsk(ID_vitesse_roue);
 	sta_tsk(ID_info_capt);
 	sta_tsk(ID_mode_course);
-	
+	sta_tsk(ID_clavier);
 
     while(1)
     {
Index: branch/mbaye/Emb_App/conf_noyau.cfg
===================================================================
--- branch/mbaye/Emb_App/conf_noyau.cfg	(revision 406)
+++ branch/mbaye/Emb_App/conf_noyau.cfg	(revision 407)
@@ -20,7 +20,7 @@
 
 // max definition
 maxdefine{
-	max_task	= 9;
+	max_task	= 10;
 	max_flag	= 3;
 	max_dtq	= 2;
 	max_cyh	= 1;
@@ -88,8 +88,16 @@
 	initial_start	= ON;
 	exinf	= 0x0;
 };
-
 task[]{
+	entry_address	= clavier();
+	name	= ID_clavier;
+	stack_size	= 512;
+	stack_section	= stack;
+	priority	= 10;
+	initial_start	= ON;
+	exinf	= 0x0;
+};
+task[]{
 	entry_address	= periph_tx();
 	name	= ID_periph_tx;
 	stack_size	= 256;
