|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2014-6-22 11:59:38
|
显示全部楼层
但是如果在程序里面加入一大段代码的话,似乎就不会超出地址空间。。
就像:
void main(void)
{
//uchar error_num = 0;
init_5110();
GPS_Init(); //初始化GPS
// Uart_Init(); //初始化串口
// rev_stop=0;
// REV_NO;
/* while(1)
{
/* if (rev_stop) //如果接收完一行
{
TR0 = 1; //开启定时器
REV_YES;
if (change_page % 2 == 1) //换页
{
if (GPS_GGA_Parse(rev_buf, &GPS)) //解析GPGGA
{
GGA_YES;
//
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第一页信息
error_num = 0;
gps_flag = 0;
rev_stop = 0;
led1 = 1;
}
else
{
error_num++;
if (error_num >= 20) //如果数据无效超过20次
{
RMC_NO;
error_num = 20;
GPS_Init(); //返回初始化
}
gps_flag = 0;
rev_stop = 0;
REV_NO;
}
}
}*/
//}
}
/*void timer0(void) interrupt 1
{
static uchar count = 0;
TH0 = 0x3c;
TL0 = 0xb0;
count++;
if (count == 200) //2*5秒钟
{
count = 0;
change_page++; //换页
if (change_page == 10)
change_page = 0;
}
} */
/*void Uart_Receive(void) interrupt 4
{
uchar ch;
ES = 0;
if (RI)
{
ch = SBUF;
if ((ch == '$') && (gps_flag == 0)) //如果收到字符'$',便开始接收
{
rev_start = 1;
rev_stop = 0;
}
if (rev_start == 1) //标志位为1,开始接收
{
rev_buf[num++] = ch; //字符存到数组中
if (ch == '\n') //如果接收到换行
{
rev_buf[num] = '\0';
rev_start = 0;
rev_stop = 1;
gps_flag = 1;
num = 0;
}
}
}
RI = 0; //RI清0,重新接收
ES = 1;
}
*/
这又是咋回事。。![](static/image/smiley/default/dizzy.gif) |
|