求单片机中GPS接收信号c源码 急需 各位大神帮帮忙
答案:1 悬赏:40 手机版
解决时间 2021-01-01 17:52
- 提问者网友:轻浮
- 2021-01-01 12:48
求单片机中GPS接收信号c源码 急需 各位大神帮帮忙
最佳答案
- 五星知识达人网友:孤独入客枕
- 2021-01-01 13:32
#pragma interrupt_handler uart0_rx_isr:19
//#pragma interrupt_handler uart1_rx_isr:31
void uart0_rx_isr(void)
//void uart1_rx_isr(void)
{
//led1_H;
RESERVE_temp[USART_0_i++]=UDR0;
//USART_Transmit_0(UDR0);
//USART_Transmit_0(RESERVE_temp[0]);
if ( (USART_0_i==1)&& (RESERVE_temp[0]!=0x24) ) //
{
USART_0_i=0;
//USART_Transmit_0(0xa1);
}
if ( (USART_0_i==2)&&( RESERVE_temp[1] != 0x47 )) // G
{
USART_0_i=0;
//USART_Transmit_0(0xa2);
}
if ( (USART_0_i==3)&& (RESERVE_temp[2]!=0x50) ) //P
{
USART_0_i=0;
//USART_Transmit_0(0xa3);
}
if ( (USART_0_i==4)&& (RESERVE_temp[3]!=0x52) ) //R
{
USART_0_i=0;
//USART_Transmit_0(0xa4);
}
if ( (USART_0_i==5)&& (RESERVE_temp[4]!=0x4d) ) //M
{
USART_0_i=0;
//USART_Transmit_0(0xa5);
}
if ( (USART_0_i==6)&& (RESERVE_temp[5]!=0x43) ) //C
{
USART_0_i=0;
//USART_Transmit_0(0xa6);
}
if (((USART_0_i==68)&&(RESERVE_temp[0]==0x24))&&(GX==0)) //68,GPS包位数
{
USART_0_i=0;
//USART_Transmit_0(0xaa);
PORTG = ~(BIT(PG0)&PORTG);
for (INT_i=0;INT_i<68;INT_i++)
{
RESERVE_temp_cache[INT_i]=RESERVE_temp[INT_i];
flag_Transmit_0=1;
}
GX=1;
}
}
//#pragma interrupt_handler uart1_rx_isr:31
void uart0_rx_isr(void)
//void uart1_rx_isr(void)
{
//led1_H;
RESERVE_temp[USART_0_i++]=UDR0;
//USART_Transmit_0(UDR0);
//USART_Transmit_0(RESERVE_temp[0]);
if ( (USART_0_i==1)&& (RESERVE_temp[0]!=0x24) ) //
{
USART_0_i=0;
//USART_Transmit_0(0xa1);
}
if ( (USART_0_i==2)&&( RESERVE_temp[1] != 0x47 )) // G
{
USART_0_i=0;
//USART_Transmit_0(0xa2);
}
if ( (USART_0_i==3)&& (RESERVE_temp[2]!=0x50) ) //P
{
USART_0_i=0;
//USART_Transmit_0(0xa3);
}
if ( (USART_0_i==4)&& (RESERVE_temp[3]!=0x52) ) //R
{
USART_0_i=0;
//USART_Transmit_0(0xa4);
}
if ( (USART_0_i==5)&& (RESERVE_temp[4]!=0x4d) ) //M
{
USART_0_i=0;
//USART_Transmit_0(0xa5);
}
if ( (USART_0_i==6)&& (RESERVE_temp[5]!=0x43) ) //C
{
USART_0_i=0;
//USART_Transmit_0(0xa6);
}
if (((USART_0_i==68)&&(RESERVE_temp[0]==0x24))&&(GX==0)) //68,GPS包位数
{
USART_0_i=0;
//USART_Transmit_0(0xaa);
PORTG = ~(BIT(PG0)&PORTG);
for (INT_i=0;INT_i<68;INT_i++)
{
RESERVE_temp_cache[INT_i]=RESERVE_temp[INT_i];
flag_Transmit_0=1;
}
GX=1;
}
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯