Index: branch/DEMAGALHAES/sp4a12/main.c
===================================================================
--- branch/DEMAGALHAES/sp4a12/main.c	(revision 695)
+++ branch/DEMAGALHAES/sp4a12/main.c	(revision 696)
@@ -118,7 +118,7 @@
     }
 }
 
-int decode_nombre(char * ch, int n)
+int decode_nombrdistance_a_la_plus_proche_zone(pos1, zones, 2)e(char * ch, int n)
 {
     int longueurMot=0;
     char caratereCourrant=0;
@@ -151,7 +151,7 @@
     }
 }
 
-float CharVersDegre(char* ch)
+float CharVersDegre(char * ch)
 {
       char * nombre=ch;
       float dec;
@@ -171,11 +171,11 @@
                   n=compte-1;
                   continue;
             }
-            int d = *ch - '0';
+            float d = *ch - '0';
             if (d >= 0 && d <= 9)
             {
                   if (virguleVu) fact /= 10.0;
-                  res = res * 10.0 + (float)d;
+                  res = res * 10.0 + d;
             }
             if (*ch == ',')
             {
@@ -193,7 +193,8 @@
             degre=decode_nombre(nombre,3);
             dec=(dec-degre*100)/60;
       }
-      return (degre+dec);
+      dec = degre + dec;
+      return dec;
 }
 
 Position decode_trame(char * ch)
@@ -288,7 +289,7 @@
     cpt++;
     printf ("> %s\n",trame);
 }
-
+distance_a_la_plus_proche_zone(pos1, zones, 2)
 //Ajouter vos tests unitaires dans cette fonction.
 void tests_unitaires(void){
     printf("Test de la fonction trame_cmp \n");
@@ -383,7 +384,6 @@
     test_decode_int();
     test_decode_nombre();
     test_decode_trame();
-
     // Affichage des trames definies dans la table trames.
     printf ("Trames de tests tableau trames:\n");
     int i=0;
Index: branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_Simulator.hsf
===================================================================
--- branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_Simulator.hsf	(revision 695)
+++ branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_Simulator.hsf	(revision 696)
@@ -7,11 +7,108 @@
 [INFORMATION]
 "" 
 [GENERAL_DATA]
+"FIRST_CONNECTION_TAG" "NO" 
 "RESET_CPU_AFTER_DOWNLOAD_TAG" "VARIANT_TRUE_STORE_TAG" 
+"{06B7701B-5400-4F73-A98D-DFB20141B565}PDTaskTraceCtrlAnalyzeViews" "0" 
+"{06B7701B-5400-4F73-A98D-DFB20141B565}PDTaskTraceCtrlTraceViews" "0" 
+"{18AEA759-3561-4CC5-9908-97D74B956935}PDCoverageCtrlViews" "0" 
+"{1D0B3B27-B01D-4E8C-8848-E2E7F5EEFD73}PDOutputPortCtrlViews" "0" 
+"{210D75A5-E8B6-462A-A69C-EFB481B02BD1}PDScriptCtrlViews" "0" 
+"{287A8023-99B5-49E1-A54E-4DDCA43D7959}MapCtrlECX_MAP_FIND_SYMBOL_LIST" "" 
+"{287A8023-99B5-49E1-A54E-4DDCA43D7959}MapCtrlViews" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusCtrlViews" "1" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ColWidth0" "224" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ColWidth1" "152" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ScrollHorz" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ScrollVert" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ColWidth0" "160" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ColWidth1" "432" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ScrollHorz" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ScrollVert" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ColWidth0" "80" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ColWidth1" "248" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ScrollHorz" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ScrollVert" "0" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBatchFileName" "" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBreakpointFlag" "-1 " 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBreakpointStatus" "-1 " 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBrowseDirectory" "" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlLogFileName" "" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlSplitterPosition" "242" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlViews" "0" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}TclTkCtrlLogFileName" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_COMPARE_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_COMPARE_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_DEST_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_FILL_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_FILL_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_MOVE_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_MOVE_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_SEARCH_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_SEARCH_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_SET_DEST_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_TEST_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_TEST_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}MemoryCtrlViews" "0" 
+"{348532CE-10A4-4D46-B946-95A8279582D2}RamMonitorCtrlViews" "0" 
+"{348532CE-10A4-4D46-B946-95A8279582D2}RamMonitorWndRRAM Monitor AreaCount" "1" 
+"{348532CE-10A4-4D46-B946-95A8279582D2}RamMonitorWndRRAM Monitor AreaSize0" "1" 
+"{348532CE-10A4-4D46-B946-95A8279582D2}RamMonitorWndRRAM Monitor AreaStart0" "00000400" 
+"{55384715-F881-421C-A548-D7D1ABE158E1}PDMRCtrlViews" "0" 
+"{5A6890B2-17C2-4AB3-B941-0F899F6A3D76}PDSwbreakwinCtrlViews" "0" 
+"{5F04F1E1-BD88-46BA-A9C2-A5DDBFED8D0C}PDMRTraceCtrlAnalyzeViews" "0" 
+"{5F04F1E1-BD88-46BA-A9C2-A5DDBFED8D0C}PDMRTraceCtrlTraceViews" "0" 
+"{6C4D5B81-FD67-46A9-A089-EA44DCDE47FD}RAMMonitorManagerCtrlBlockInfoFileDir" "" 
+"{6C4D5B81-FD67-46A9-A089-EA44DCDE47FD}RAMMonitorManagerCtrlBlockInfoFileName" "" 
+"{7943C44E-7D44-422A-9140-4CF55C88F7D3}DifferenceCtrlViews" "0" 
+"{811C3B34-DDC2-42E9-8FA8-7AEAA822FF18}PDDataTraceCtrlViews" "0" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE" "00000000,00000000,0,0" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_ADDRESS_NAME" "" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_COMB_ADDRESS" ",,,," 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_COMB_BUFFER" ",,,," 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_SAMPLING_RATE" "1000" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}WaveformCtrlViews" "0" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersCtrlViews" "0" 
+"{98DFB68C-498C-4346-A6B8-C7260C534267}PDTraceCtrlViews" "0" 
+"{99F424FE-E727-45AE-AE1F-11E29DEF272C}ECX_GuiIO_SAMPLING_RATE" "1000" 
+"{99F424FE-E727-45AE-AE1F-11E29DEF272C}PDGuiIOCtrlPDGuiIOLastSaveDirectory" "" 
+"{99F424FE-E727-45AE-AE1F-11E29DEF272C}PDGuiIOCtrlViews" "0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_ADDRESS_NAME" "" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_BUFFER" "00000000,00000000,0,0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_COLOR" "0,0,0,0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_COMB_ADDRESS" ",,,," 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_COMB_PALETTE" ",,,," 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_PALETTE_NAME" "" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_REDRAW_CONTINUOUSLY" "0,2" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_SAMPLEING_RATE" "1000" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_VIEW" "0,0,0,0,0,0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ImageCtrlViews" "0" 
+"{B13462A1-157A-4D86-9BA3-66117A68F1A2}FirstLoadOnV103" "0" 
+"{BFEEE25F-801F-44A7-A6F1-D8C60837CD32}PDHWBreakCtrlViews" "0" 
+"{C27248CC-BDC9-414E-A340-12AFD36A7AF8}PDIOTimingCtrlViews" "0" 
+"{C62E6398-F79C-4FAB-801E-8B1A464777C3}CWatchCtrlViews" "0" 
+"{C62E6398-F79C-4FAB-801E-8B1A464777C3}CWatchWnd_InitialRadix" "Default" 
+"{C62E6398-F79C-4FAB-801E-8B1A464777C3}CWatchWnd_TAB" "Global,File Local,Local," 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ASMWatchCtrlViews" "0" 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ASMWatchWnd_AddressArea" "1" 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ASMWatchWnd_PointNum" "0" 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ASMWatchWnd_RramEnable" "1" 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ASMWatchWnd_Sampling" "100" 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ASMWatchWnd_SizeArea" "1" 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ECX_ASMWATCH_DLG_BIT_ADDR" "" 
+"{D465B72E-4328-4D5D-B49F-992C2C8B1EE9}ECX_ASMWATCH_DLG_SYMBOL_ADDR" "" 
+"{E6D16242-FB42-44CE-B289-ED9FE8563816}MR308DXCtrlViews" "0" 
+"{EEDC9301-6FBE-11D5-8613-00A024591A38}StackTraceCtrlViews" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlIOFile" "" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlSaveFileDir" "$(CONFIGDIR)" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlSaveFileName" "" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlViews" "0" 
 [LANGUAGE]
 "English" 
 [CONFIG_INFO_VD1]
-0 
+1 
 [CONFIG_INFO_VD2]
 0 
 [CONFIG_INFO_VD3]
@@ -19,10 +116,36 @@
 [CONFIG_INFO_VD4]
 0 
 [WINDOW_POSITION_STATE_DATA_VD1]
+"Help" "TOOLBAR 0" 59419 1 5 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 1 "0.42" 328 683 371 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
+"{WK_00000001_STATUS}SP4b3SessionM32C_Simulator" "WINDOW" 59422 0 0 "0.58" 328 -7 0 350 200 18 0 "" "0.0" 
+"{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 329 683 371 350 200 18 0 "" "0.0" 
+"{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000002_EDITOR}" "TOOLBAR 0" 59419 0 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000003_BOOKMARKS}" "TOOLBAR 0" 59419 1 1 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000004_TEMPLATES}" "TOOLBAR 0" 59419 1 0 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000005_SEARCH}" "TOOLBAR 0" 59419 0 1 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000007_DEBUG}" "TOOLBAR 0" 59419 2 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000008_DEBUGRUN}" "TOOLBAR 0" 59419 2 1 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000009_VERSIONCONTROL}" "TOOLBAR 0" 59419 1 3 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000011_CPU}" "TOOLBAR 0" 59419 2 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000012_MAP}" "TOOLBAR 0" 59419 1 4 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000013_SYMBOL}" "TOOLBAR 0" 59419 2 3 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000014_CODE}" "TOOLBAR 0" 59419 2 6 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000016_GRAPHIC}" "TOOLBAR 0" 59419 2 5 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000018_DEFAULTWINDOW}" "TOOLBAR 0" 59419 1 2 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000021_TRACE}" "TOOLBAR 0" 59419 2 8 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000022_BREAK}" "TOOLBAR 0" 59419 2 7 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000023_RTOS}" "TOOLBAR 0" 59419 2 9 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000026_MACRO}" "TOOLBAR 0" 59419 1 6 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000028_RTOSDEBUG}" "TOOLBAR 0" 59419 2 4 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000029_SYSTEMTOOL}" "TOOLBAR 0" 59419 2 10 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
 [WINDOW_POSITION_STATE_DATA_VD2]
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"D:\tp_sp4_2021_de_magalhaes\sp4b3\SP4b3\SP4b3.c" 
+"D:\tp_sp4_2021_de_magalhaes\sp4b3\SP4b3\ncrt0.a30" 
 [TARGET_NAME]
 "M32C Simulator" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -65,8 +188,9 @@
 "1" 
 [COMMAND_FILES]
 [DEFAULT_DEBUG_FORMAT]
-"" 
+"IEEE695_RENESAS" 
 [FLASH_DETAILS]
 "" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
 [BREAKPOINTS]
+"d:\tp_sp4_2021_de_magalhaes\sp4b3\sp4b3\sp4b3.c" 43 16647326 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_E8a_SYSTEM.ini
===================================================================
--- branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_E8a_SYSTEM.ini	(revision 695)
+++ branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_E8a_SYSTEM.ini	(revision 696)
@@ -18,7 +18,11 @@
 PROCESSOR_MODE=0
 [COMMUNI]
 COMSPEED=8
+COMSPEED PROGRAM FLASH=8
+COMSPEED DATA FLASH=8
 [Driver Configuration]
 Renesas Communications=USB interface,0,
 [Target]
 M32C E8a SYSTEM=Renesas Communications
+[USER_DATA]
+RESET=fe004a
Index: branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_E8a_SYSTEM.hsf
===================================================================
--- branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_E8a_SYSTEM.hsf	(revision 695)
+++ branch/DEMAGALHAES/sp4b3/SP4b3/SessionM32C_E8a_SYSTEM.hsf	(revision 696)
@@ -7,11 +7,140 @@
 [INFORMATION]
 "" 
 [GENERAL_DATA]
+"FIRST_CONNECTION_TAG" "NO" 
+"MRULABELS_DATAMANAGER_KEY" "FE004A|FE0196" 
 "RESET_CPU_AFTER_DOWNLOAD_TAG" "VARIANT_TRUE_STORE_TAG" 
+"{287A8023-99B5-49E1-A54E-4DDCA43D7959}MapCtrlECX_MAP_FIND_SYMBOL_LIST" "" 
+"{287A8023-99B5-49E1-A54E-4DDCA43D7959}MapCtrlViews" "0" 
+"{2BA6A3EE-6488-11D5-80D4-00C04F68EAD7}ECXLABEL_ADDDLG_ADDR" "" 
+"{2BA6A3EE-6488-11D5-80D4-00C04F68EAD7}LabelCtrlSymbolFileDir" "" 
+"{2BA6A3EE-6488-11D5-80D4-00C04F68EAD7}LabelCtrlSymbolFileName" "" 
+"{2BA6A3EE-6488-11D5-80D4-00C04F68EAD7}LabelCtrlViews" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusCtrlViews" "1" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ColWidth0" "224" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ColWidth1" "224" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ScrollHorz" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd0ScrollVert" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ColWidth0" "160" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ColWidth1" "328" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ScrollHorz" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd1ScrollVert" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ColWidth0" "8" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ColWidth1" "360" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ScrollHorz" "0" 
+"{2BA6A3EF-6488-11D5-80D4-00C04F68EAD7}StatusWnd2ScrollVert" "0" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBatchFileName" "" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBreakpointFlag" "-1 " 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBreakpointStatus" "-1 " 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlBrowseDirectory" "" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlLogFileName" "" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlSplitterPosition" "242" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}CmdLineCtrlViews" "0" 
+"{313F4FC1-6566-11D5-8BBE-0004E2013C71}TclTkCtrlLogFileName" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_COMPARE_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_COMPARE_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_DEST_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_DISPLAY_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_FILL_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_FILL_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_MOVE_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_MOVE_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_SEARCH_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_SEARCH_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_SET_DEST_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_TEST_END_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}ECX_MEMORY_TEST_START_ADDRESS" "" 
+"{313F4FC2-6566-11D5-8BBE-0004E2013C71}MemoryCtrlViews" "0" 
+"{4B022541-3E95-11D7-909C-00201898052D}ElfDwarf2Objects" "1" 
+"{4B022541-3E95-11D7-909C-00201898052D}LoadModule0OBJ_ELFDWARF2_ARRAY_EXPAND_LIMIT" "-1" 
+"{4B022541-3E95-11D7-909C-00201898052D}LoadModule0OBJ_STATUS_OF_EBD_CMD" "0" 
+"{55384715-F881-421C-A548-D7D1ABE158E1}PDMRCtrlViews" "0" 
+"{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" "0000000000000001" 
+"{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" 
+"{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" "0000000000000400" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_16" "0000000000FE0340" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_17" "0000000000FFFD00" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_18" "00000000000006FC" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_19" "0000000000000A00" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_2" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_20" "0000000000000080" 
+"{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" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_24" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_25" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_26" "0000000000000000" 
+"{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_30" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_31" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_32" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_33" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_34" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_35" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_4" "0000000000FE0049" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_5" "0000000000020000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_6" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_7" "0000000000000400" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_8" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_9" "0000000000000000" 
+"{64753FED-D387-4B8C-A91D-D3419C869C07}C_REGISTER_REG_COUNT" "36" 
+"{6C4D5B81-FD67-46A9-A089-EA44DCDE47FD}RAMMonitorManagerCtrlBlockInfoFileDir" "" 
+"{6C4D5B81-FD67-46A9-A089-EA44DCDE47FD}RAMMonitorManagerCtrlBlockInfoFileName" "" 
+"{7943C44E-7D44-422A-9140-4CF55C88F7D3}DifferenceCtrlViews" "0" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE" "00000000,00000000,0,0" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_ADDRESS_NAME" "" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_COMB_ADDRESS" ",,,," 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_COMB_BUFFER" ",,,," 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}ECX_WAVE_SAMPLING_RATE" "1000" 
+"{8A898260-6F1D-11D5-8EB6-00004CC34E9D}WaveformCtrlViews" "0" 
+"{95A081A1-7001-11D5-B1FD-00A0C9E23A58}RegistersCtrlViews" "0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_ADDRESS_NAME" "" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_BUFFER" "00000000,00000000,0,0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_COLOR" "0,0,0,0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_COMB_ADDRESS" ",,,," 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_COMB_PALETTE" ",,,," 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_PALETTE_NAME" "" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_REDRAW_CONTINUOUSLY" "0,2" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_SAMPLEING_RATE" "1000" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ECX_IMAGE_VIEW" "0,0,0,0,0,0" 
+"{AC411480-6F0A-11D5-8EB6-00004CC34E9D}ImageCtrlViews" "0" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchCtrlViews" "0" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndInitial_Radix" "0" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndRecentFile_WatchRecord" "" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndRecentFile_WatchSave" "" 
+"{B266D880-6FA1-11D5-8613-00A024591A38}WatchWndUpdate_Interval" "100" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_CONFIG_FLASH_MODE" "0" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_CONFIG_GOOPTION" "0 5 0 0" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_CONFIG_ROUND" "RM_NEAR" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_CONFIG_STEPOPTION" "0" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_EVENT_BC1" "0,0,1,0,1,0,1,0,0,0" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_EVENT_BC2" "0,0,1,0,1,0" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_EVENT_BC3" "0,0,1,0,1,0,1,0,0,0" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_EVENT_BC4" "0,0,1,0,1,0,1,0,0,0" 
+"{D3D4595F-12B4-4866-8F9A-78C30AC967E3}T_SESSION_IS_SAVED" "YES" 
+"{D595F9C0-EF22-11D5-B7DB-0000E10B3DA9}EventCtrlViews" "0" 
+"{E6D16242-FB42-44CE-B289-ED9FE8563816}MR308DXCtrlViews" "0" 
+"{EEDC9300-6FBE-11D5-8613-00A024591A38}LocalsCtrlViews" "0" 
+"{EEDC9301-6FBE-11D5-8613-00A024591A38}StackTraceCtrlViews" "0" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlIOFile" "" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlSaveFileDir" "$(CONFIGDIR)" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlSaveFileName" "" 
+"{F866DB60-6186-11D5-8BBE-0004E2013C71}IOCtrlViews" "0" 
 [LANGUAGE]
 "English" 
 [CONFIG_INFO_VD1]
-0 
+1 
 [CONFIG_INFO_VD2]
 0 
 [CONFIG_INFO_VD3]
@@ -19,10 +148,34 @@
 [CONFIG_INFO_VD4]
 0 
 [WINDOW_POSITION_STATE_DATA_VD1]
+"Help" "TOOLBAR 0" 59419 1 5 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_00000001_OUTPUT}" "WINDOW" 59422 0 1 "0.50" 312 683 371 350 200 18 0 "36756|36757|36758|36759|<<separator>>|36746|36747|<<separator>>|39531|<<separator>>|39500|39534|<<separator>>|36687" "0.0" 
+"{WK_00000001_STATUS}SP4b3SessionM32C_E8a_SYSTEM" "WINDOW" 59422 0 0 "0.50" 312 -7 0 350 200 18 0 "" "0.0" 
+"{WK_00000002_WORKSPACE}" "WINDOW" 59420 0 0 "1.00" 180 683 371 350 200 18 0 "" "0.0" 
+"{WK_TB00000001_STANDARD}" "TOOLBAR 0" 59419 0 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000002_EDITOR}" "TOOLBAR 0" 59419 0 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000003_BOOKMARKS}" "TOOLBAR 0" 59419 1 1 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000004_TEMPLATES}" "TOOLBAR 0" 59419 1 0 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000005_SEARCH}" "TOOLBAR 0" 59419 0 1 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000007_DEBUG}" "TOOLBAR 0" 59419 2 0 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000008_DEBUGRUN}" "TOOLBAR 0" 59419 2 1 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000009_VERSIONCONTROL}" "TOOLBAR 0" 59419 1 3 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000011_CPU}" "TOOLBAR 0" 59419 2 2 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000012_MAP}" "TOOLBAR 0" 59419 1 4 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000013_SYMBOL}" "TOOLBAR 0" 59419 2 3 "0.00" 0 0 0 0 0 18 0 "" "0.0" 
+"{WK_TB00000014_CODE}" "TOOLBAR 0" 59419 2 6 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000016_GRAPHIC}" "TOOLBAR 0" 59419 2 7 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000018_DEFAULTWINDOW}" "TOOLBAR 0" 59419 1 2 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000023_RTOS}" "TOOLBAR 0" 59419 2 8 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000026_MACRO}" "TOOLBAR 0" 59419 1 6 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000028_RTOSDEBUG}" "TOOLBAR 0" 59419 2 4 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
+"{WK_TB00000029_SYSTEMTOOL}" "TOOLBAR 0" 59419 2 5 "0.00" 0 0 0 0 0 17 0 "" "0.0" 
 [WINDOW_POSITION_STATE_DATA_VD2]
 [WINDOW_POSITION_STATE_DATA_VD3]
 [WINDOW_POSITION_STATE_DATA_VD4]
 [WINDOW_Z_ORDER]
+"D:\tp_sp4_2021_de_magalhaes\sp4b3\SP4b3\SP4b3.c" 
+"D:\tp_sp4_2021_de_magalhaes\sp4b3\SP4b3\ncrt0.a30" 
 [TARGET_NAME]
 "M32C E8a SYSTEM" "" 0 
 [STATUSBAR_STATEINFO_VD1]
@@ -46,7 +199,7 @@
 [STATUSBAR_DEBUGGER_PANESTATE_VD3]
 [STATUSBAR_DEBUGGER_PANESTATE_VD4]
 [DEBUGGER_OPTIONS]
-"Unknown Options" 
+"[B|SIMIOF|1] [I|SIMIOADR|0x00000000] [S|ROM_MODE|^"^"] [S|MAP|^"^"] [S|RESOURCE|^"^"]" 
 [DOWNLOAD_MODULES]
 "$(CONFIGDIR)\$(PROJECTNAME).x30" 0 "IEEE695_RENESAS" 0 0 1 0 
 [CONNECT_ON_GO]
@@ -65,8 +218,9 @@
 "1" 
 [COMMAND_FILES]
 [DEFAULT_DEBUG_FORMAT]
-"" 
+"IEEE695_RENESAS" 
 [FLASH_DETAILS]
 "" 0 0 "" 0 "" 0 0 "" 0 0 0 0 0 0 0 "" "" "" "" "" 
 [BREAKPOINTS]
+"d:\tp_sp4_2021_de_magalhaes\sp4b3\sp4b3\sp4b3.c" 19 16646976 1 "{00000000-0000-0000-C000-000000000046}" "" 
 [END]
Index: branch/DEMAGALHAES/sp4b3/SP4b3/SP4b3.c
===================================================================
--- branch/DEMAGALHAES/sp4b3/SP4b3/SP4b3.c	(revision 695)
+++ branch/DEMAGALHAES/sp4b3/SP4b3/SP4b3.c	(revision 696)
@@ -9,7 +9,295 @@
 /*  NOTE:THIS IS A TYPICAL EXAMPLE.                                    */
 /***********************************************************************/
 
+typedef struct{
+    float latitude;
+    float longitude;
+}Position;
+
+
+typedef struct {
+      Position rpos;
+      float vitmax;
+} Zone;
+
+float CharVersDegre(char * ch);
+Position decode_trame(char * ch);
+float calcul_distance(Position p1,Position p2);
+float calcul_vitesse(float distance);
+float distance_a_la_plus_proche_zone(Position pos_voiture, Zone r[], int nb_zones);
+
 void main(void)
 {
-	
+	Zone zones[] = {
+	{{44.7887762, -3.012}, 50}, /* Descripteur de la premi�re zone */
+	{{44.7891220, -3.013}, 70},
+	};
+    while (1)
+	{
+		float distance=0;
+		Position pos1=decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D");
+      	Position pos2=decode_trame("$GPGGA,141925.00,4545.2410,N,00306.6046,E,1,05,3.4,501.4,M,,M,,*7D");
+		distance = calcul_distance(pos1,pos2);
+		calcul_vitesse(distance);
+		distance_a_la_plus_proche_zone(pos1, zones, 2);
+	}
 }
+
+float distance_a_la_plus_proche_zone(Position pos_voiture, Zone r[], int nb_zones)
+{
+      int i;
+	  int indice_rechercher=0;
+	  float d_min=0,d=0;
+      Position t[10];
+      for (i = 0; i < nb_zones; i++)
+      {
+            Position pos=r[i].rpos;
+            t[i]=pos;
+      }
+      d_min=calcul_distance(pos_voiture,t[1]);
+      for (i = 0; i < nb_zones; i++)
+      {
+            d=calcul_distance(pos_voiture,t[i]);
+            if (d<d_min)
+            {
+                  d_min=d;
+                  indice_rechercher=i;
+            }
+            if (nb_zones==0)
+            {
+                  return -1;
+            }
+      }
+      return d_min;
+}
+
+float calcul_vitesse(float distance)
+{
+      return distance*3600;
+}
+
+float calcul_distance(Position p1,Position p2)
+{
+      float R_terre=6378.137;
+      float distance = R_terre*(p1.latitude-p2.latitude)*(3.14/180);
+      return distance;
+}
+
+Position decode_trame(char * ch)
+{
+      Position pos;
+      int i,indice=0;
+      char longitude[10]="";
+      char latitude[10]="";
+      int compteur_de_virgule = 0;
+      if (trame_cmp(ch,"GPGGA")==0)
+      {
+            exit(-1);
+      }
+      else
+      {
+
+            do
+            {
+                  if (ch[indice]==',')
+                  {
+                        compteur_de_virgule++;
+                  }
+
+                  if (compteur_de_virgule==2)
+                  {
+                        for (i = 0; i < 9; i++)
+                        {
+                              latitude[i]=ch[indice+1];
+                              indice++;
+                        }
+                  }
+
+                  if (compteur_de_virgule==4)
+                  {
+                        for (i = 0; i < 9; i++)
+                        {
+                              longitude[i]=ch[indice+1];
+                              indice++;
+                        }
+                        break;
+                  }
+                  indice++;
+            } while (ch[indice]!='\0');
+            pos.latitude = CharVersDegre(latitude);
+            pos.longitude = CharVersDegre(longitude);
+      }
+      return pos;
+}
+
+float CharVersDegre(char * ch)
+{
+      char * nombre=ch;
+      float dec;
+      int compte=0,n,degre;
+	  int virguleVu=0;
+      float res = 0, fact = 1, d=0;
+      if (*ch == '-')
+      {
+            ch++;
+            fact = -1;
+      }
+      for (virguleVu = 0; *ch; ch++)
+      {
+            compte++;
+            if (*ch == '.')
+            {
+                  virguleVu = 1;
+                  n=compte-1;
+                  continue;
+            }
+			d = *ch - '0';
+            if (d >= 0 && d <= 9)
+            {
+                  if (virguleVu) fact /= 10.0;
+                  res = res * 10.0 + d;
+            }
+            if (*ch == ',')
+            {
+                  break;
+            }
+      }
+      dec=(res * fact);
+      if (n==4)
+      {
+            degre=decode_nombre(nombre,2);
+            dec=(dec-degre*100)/60;
+      }
+      else if (n==5)
+      {
+            degre=decode_nombre(nombre,3);
+            dec=(dec-degre*100)/60;
+      }
+	  dec = degre + dec;
+      return dec;
+}
+
+int decode_nombre(char * ch, int n)
+{
+    int longueurMot=0;
+    char caratereCourrant=0;
+    //Obtention de la longueur du Mot extrait entre le symbole $ et la virgule
+    do
+    {
+        caratereCourrant=ch[longueurMot];
+        longueurMot++;
+    }
+    while (caratereCourrant != '\0');
+    longueurMot--;
+    if (longueurMot < n ||n==0){
+        return 0;
+    }
+    else{
+        int j=0,sum=0;
+        for(j=0; j<n; j++)
+        {
+            if(ch[j] < 48 || ch[j] > 57)
+            {
+                return 0;
+            }
+            else
+            {
+                sum = sum*10 + (ch[j] - 48);
+            }
+        }
+        return sum;
+    }
+}
+
+int decode_int(char c)
+{
+    int code;
+    char i;
+    if(c >= '0' && c <= '9')
+        // Verification que le caract�re 'c' est un caract�re entre 0 et 9 dans la table ascii
+    {
+        for (i= '0'; i <='9'; i++)
+            //Parcourir la table ascii � la recherche du carac. c
+        {
+            if (i==c)
+                // Identification du carac. c dans la table ascii
+            {
+                code=i-48; // On ram�ne le code ascii de c entre 0 et 9
+                return code;
+            }
+        }
+    }
+    else
+    {
+        // le caract�re 'c' n'est pas entre '0' et '9' dans la table ascii donc on renvoie -1
+        return -1;
+    }
+}
+					
+int trame_cmp(char * trame, char * type)
+{
+    int indice=1;
+    char mot[10]="";
+    int longueurMot=0;
+    int longueurType=0;
+    char caratereCourrant=0;
+	//Extraction du mot entre le symbole $ et la virgule
+	do
+    {
+        mot[indice-1]=trame[indice];
+        indice++;
+    }
+    while (trame[indice]!=',');
+
+    //Obtention de la longueur du Mot extrait entre le symbole $ et la virgule
+    do
+    {
+        caratereCourrant=mot[longueurMot];
+        longueurMot++;
+    }
+    while (caratereCourrant != '\0');
+    longueurMot--;
+
+    caratereCourrant=0;
+    ////Obtention de la longueur du type
+    do
+    {
+        caratereCourrant=type[longueurType];
+        longueurType++;
+    }
+    while (caratereCourrant != '\0');
+    longueurType--;
+
+    if (longueurType==longueurMot) //Verification si le type est de m�me taille que le mot extrait
+    {
+        int verificateur=0; //varaiable de validation
+		int i;
+        for (i = 0; i < longueurMot; i++)
+        {
+            if (mot[i]==type[i])
+            {
+                verificateur=1; // Valide la comparaison entre deux lettres identiques
+            }
+            else
+            {
+                verificateur=0; // Si la comparaison n'est pas bonne, on arr�te la comparaison
+                break;
+            }
+        }
+        if (verificateur==1 && type=="GPGGA")
+        {
+            // Condition de renvoie si le type est bien GPGGA
+            return 1;
+        }
+        else
+        {
+            // return 0 pour tout les test qui ne seraient pas du type GPGGA
+            return 0;
+        }
+    }
+    else
+    {
+        // return 0 si aucune comparaison n'est bonne
+        return 0;
+    }
+}
Index: branch/DEMAGALHAES/Mesure_temps_fction_HEW.txt
===================================================================
--- branch/DEMAGALHAES/Mesure_temps_fction_HEW.txt	(nonexistent)
+++ branch/DEMAGALHAES/Mesure_temps_fction_HEW.txt	(revision 696)
@@ -0,0 +1,69 @@
+trame_cmp("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D","GPGGA");
+sans modif. 665 cycles = 33µs
+
+trame_cmp("$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C","GPGGA");
+sans modif. 612 cycles = 30µs
+
+-----------------------------------------------------------------------------------------
+
+decode_int('9');
+sans modif. 196 cycles = 9µs
+
+decode_int('5');
+sans modif. 128 cycles = 6µs
+
+decode_int('0');
+sans modif. 43 cycles = 2µs
+
+-----------------------------------------------------------------------------------------
+
+decode_nombre("7",1);
+sans modif. 158 cycles = 7 µs
+
+decode_nombre("7541",2);
+sans modif. 280 cycles = 14 µs
+
+decode_nombre("7541",4); / decode_nombre("9999",4);
+sans modif. 404 cycles = 20 µs
+
+-----------------------------------------------------------------------------------------
+
+CharVersDegre("4545.0000");
+sans modif. (float) 25 015 cycles = 1ms250µs
+
+CharVers Degre("00306.6036");
+sans modif. (float) 26 277 cycles = 1ms313µs
+
+-----------------------------------------------------------------------------------------
+
+decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D");
+sans modif. (float) 48 891 cycles = 2ms444µs
+
+-----------------------------------------------------------------------------------------
+
+Position pos1=decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D");
+Position pos2=decode_trame("$GPGGA,141925.00,4545.2410,N,00306.6046,E,1,05,3.4,501.4,M,,M,,*7D");
+
+calcul_distance(pos1,pos2);
+sans modif. (float) 1312 cycles = 65µs
+
+-----------------------------------------------------------------------------------------
+
+Position pos1=decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D");
+Position pos2=decode_trame("$GPGGA,141925.00,4545.2410,N,00306.6046,E,1,05,3.4,501.4,M,,M,,*7D");
+distance = calcul_distance(pos1,pos2);
+
+calcul_vitesse(distance);
+sans modif. (float) 192 cycles = 9µs
+
+-----------------------------------------------------------------------------------------
+
+Position pos1=decode_trame("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D");
+Position pos2=decode_trame("$GPGGA,141925.00,4545.2410,N,00306.6046,E,1,05,3.4,501.4,M,,M,,*7D");
+distance = calcul_distance(pos1,pos2);
+calcul_vitesse(distance);
+
+distance_a_la_plus_proche_zone(pos1, zones, 2);
+sans modif. (float) 4211 cycles = 210 µs
+
+-----------------------------------------------------------------------------------------
\ No newline at end of file
