遇到麻烦了
时间:10-02
整理:3721RD
点击:
我是个菜鸟,不懂,哪位大神帮忙看看
void main(void)
{
uchar error_num = 0;
dula = 0;
wela = 0;
Uart_Init(); //初始化串口
Lcd_Init(); //初始化LCD
GPS_Init(); //初始化GPS
while(1)
{
if (rev_stop) //如果接收完一行
{
TR0 = 1; //开启定时器
REV_YES;
if (change_page % 2 == 1) //换页
{
if (GPS_GGA_Parse(rev_buf, &GPS)) //解析GPGGA
{
GGA_YES;
GPS_DisplayTwo(); //显示第二页信息
error_num = 0;
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
else
{
error_num++;
if (error_num >= 20) //如果数据无效超过20次
{
GGA_NO;
error_num = 20;
GPS_Init(); //返回初始化
}
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
}
else
{
if (GPS_RMC_Parse(rev_buf, &GPS)) //解析GPRMC
{
RMC_YES;
GPS_DisplayOne(); //显示GPS第一页信息
error_num = 0;
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
else
{
error_num++;
if (error_num >= 20) //如果数据无效超过20次
{
RMC_NO;
error_num = 20;
GPS_Init(); //返回初始化
}
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
}
}
}
}
里面的uchar error_num = 0;
dula = 0;
wela = 0;是什么意思呀,还有程序分模块写怎么编译不了。
void main(void)
{
uchar error_num = 0;
dula = 0;
wela = 0;
Uart_Init(); //初始化串口
Lcd_Init(); //初始化LCD
GPS_Init(); //初始化GPS
while(1)
{
if (rev_stop) //如果接收完一行
{
TR0 = 1; //开启定时器
REV_YES;
if (change_page % 2 == 1) //换页
{
if (GPS_GGA_Parse(rev_buf, &GPS)) //解析GPGGA
{
GGA_YES;
GPS_DisplayTwo(); //显示第二页信息
error_num = 0;
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
else
{
error_num++;
if (error_num >= 20) //如果数据无效超过20次
{
GGA_NO;
error_num = 20;
GPS_Init(); //返回初始化
}
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
}
else
{
if (GPS_RMC_Parse(rev_buf, &GPS)) //解析GPRMC
{
RMC_YES;
GPS_DisplayOne(); //显示GPS第一页信息
error_num = 0;
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
else
{
error_num++;
if (error_num >= 20) //如果数据无效超过20次
{
RMC_NO;
error_num = 20;
GPS_Init(); //返回初始化
}
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
}
}
}
}
里面的uchar error_num = 0;
dula = 0;
wela = 0;是什么意思呀,还有程序分模块写怎么编译不了。
应该有个锁存器 程序前面应该有 wela(位选端)和dula(段选端)的定义才对 例如sbit wela=P2^6;dula=P2^7;
谢谢了,查看了前面的程序找到了 。
学习了