📄 gps.c.txt
字号:
/*******************************************
函数名称: clear_gprmc
功 能: 清空gprmc显示缓冲区
参 数: 无
返回值 : 无
********************************************/
void clear_gprmc(void)
{
unsigned char i;
for(i=0; i<6; i++)
{
Time[i] = 0;
Date[i] = 0;
}
for(i=0; i<9; i++)
{
Latitude[i] = 0;
}
for(i=0; i<10; i++)
{
Longitude[i] = 0;
}
for(i=0; i<4; i++)
{
Speed[i] = 0;
}
Status = 0;
NSIndicator = 0;
EWIndicator = 0;
}
/*******************************************
函数名称: Parse_gprmc
功 能: 解析GPRMC字段
参 数: 无
返回值 : 无
********************************************/
void Parse_gprmc(void)
{
unsigned char i;
char temp = 0; //读取串口
FILE* fp;
fp = fopen (UART_0_NAME, "r+"); //打开文件进行读和写
// fp = fopen (JTAG_UART_NAME, "r+");
//打开文件进行读和写
if(fp<0)
{
LcdClear();
disuart(0);
}
else
{
temp = getc(fp);
while(temp != '$')
{
temp = getc(fp);
}
temp = getc(fp);
temp = getc(fp);
temp = getc(fp);
if(temp == 'R')
{
temp = getc(fp);
if(temp == 'M')
{
temp = getc(fp);
if(temp == 'C')
{
temp =getc(fp);
if(',' == temp)
{
for(i=0; i<=6; i++)
{
Time[i] = getc(fp);
}
}
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
if(',' == temp)
{
Status = getc(fp);
}
temp =getc(fp);
if(',' == temp)
{
for(i=0; i<10; i++)
{
Latitude[i] =getc(fp);
}
}
temp =getc(fp);
if(',' == temp)
{
NSIndicator = getc(fp);
}
temp =getc(fp);
if(',' == temp)
{
for(i=0; i<11; i++)
{
Longitude[i] = getc(fp);
}
}
temp =getc(fp);
if(',' == temp)
{
EWIndicator = getc(fp);
}
temp =getc(fp);
if(',' == temp)
{
for(i=0; i<5; i++)
{
Speed[i] = getc(fp);
}
}
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
temp =getc(fp);
if(',' == temp)
{
for(i=0; i<6; i++)
{
Date[i] = getc(fp);
}
}
}
}
}
fclose(fp);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -