Révision 588
Ajouté par abseck1 il y a presque 4 ans
branch/smseck/sp4b3/sp4b3/SessionM32C_E8a_SYSTEM.ini | ||
---|---|---|
PROCESSOR_MODE=0
|
||
[COMMUNI]
|
||
COMSPEED=8
|
||
COMSPEED PROGRAM FLASH=8
|
||
COMSPEED DATA FLASH=8
|
||
[Driver Configuration]
|
||
Renesas Communications=USB interface,0,
|
||
[Target]
|
branch/smseck/sp4b3/sp4b3/SessionM32C_E8a_SYSTEM.hsf | ||
---|---|---|
[WINDOW_Z_ORDER]
|
||
"D:\smseck\sp4b3\sp4b3\sp4b3.c"
|
||
"D:\smseck\sp4b2\sp4b2\sp4b2.c"
|
||
"D:\smseck\sp4b3\sp4b3\ncrt0.a30"
|
||
[TARGET_NAME]
|
||
"M32C E8a SYSTEM" "" 0
|
||
[STATUSBAR_STATEINFO_VD1]
|
branch/smseck/sp4b3/sp4b3/sp4b3.c | ||
---|---|---|
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
|
||
/***********************************************************************/
|
||
|
||
//Trames de tests ? modifier si n?cessaire.
|
||
char * trames[]= {"$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C",
|
||
"$GPGSV,3,3,10,22,39,053,50,28,15,320,*7E",
|
||
"$GPRMC,141914.00,A,4545.6424,N,00306.6036,E,0.4,99.4,010206,,*0C",
|
||
"$GPGLL,4545.6424,N,00306.6036,E,141914.00,A*0E",
|
||
"$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",
|
||
"$GPGSA,A,3,,03,,22,14,,01,,18,,,,3.9,3.4,1.9*39",
|
||
"$GPVTG,99.4,T,,M,0.4,N,0.7,K*57",
|
||
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
|
||
//fonction trame_cmp
|
||
int trame_cmp(char *a, char *b)
|
||
{
|
||
int i;
|
||
for(i=0;i<5;i++)
|
||
{
|
||
if(a[i+1]!=b[i])
|
||
return 0;
|
||
}
|
||
return 1;
|
||
}
|
||
|
||
//fonction decode_int
|
||
int decode_int(char c)
|
||
{
|
||
int a=0;
|
||
if (c>=48 && c<=57) // caract?re compris entre '0' et '9'
|
||
int d;
|
||
d=c-48;
|
||
if(d<0 || d>9)
|
||
{
|
||
a=c-48;
|
||
return -1;
|
||
}
|
||
else
|
||
{
|
||
a=-1;
|
||
}
|
||
return a;
|
||
|
||
return d;
|
||
}
|
||
|
||
//fonction decode_nombre
|
||
int decode_nombre(char *ch,int n)
|
||
{
|
||
int tab[n],i,r=0;
|
||
for(i=0;i<n;i++)
|
||
int trame_cmp(char * trame, char * type) // declaration de la fonction de comparaison de deux chaines
|
||
{
|
||
if (!strncmp(trame+1,type,strlen(type)))
|
||
return 1;
|
||
|
||
return 0;
|
||
|
||
|
||
int i;
|
||
for (i=0; i<strlen(type); i++) // parcours de la longueur du type
|
||
{
|
||
tab[i]=decode_int(ch[i]);
|
||
r=r+tab[i]*pow(10,n-i-1);
|
||
if (trame[i+1] != type[i]) // inegalit? entre les caracteres
|
||
return 0; // renvoie 0
|
||
}
|
||
return r;
|
||
}
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
{
|
||
return 1; // renvoie 1
|
||
|
||
static int cpt=0;
|
||
cpt++;
|
||
if(trame_cmp(trame,"GPGGA")==1)
|
||
{
|
||
printf ("> %s\n",trame);
|
||
}
|
||
|
||
}
|
||
int main(int argc,char ** argv)
|
||
{
|
||
|
||
tests_unitaires();
|
||
|
||
// Affichage des trames definies dans la table trames.
|
||
printf ("Trames de tests tableau trames:\n");
|
||
int i=0;
|
||
while (trames[i])
|
||
traitement(trames[i++]);
|
||
|
||
if (!trame_init())
|
||
exit(-1);
|
||
// Affichage des trames du fichier gps.log
|
||
char *trame;
|
||
printf ("Trames de tests du fichier gps.log\n");
|
||
while ((trame = trame_suivante()))
|
||
traitement(trame);
|
||
|
||
return 0;
|
||
}
|
||
|
||
|
||
|
||
void main (void)
|
||
{
|
||
int c;
|
||
decode_int('5');
|
||
}
|
Formats disponibles : Unified diff
Reprendre a partir de trp