[mw_shl_code=c,true]void Check_GPIO_PutMessage(char*num)
{
char* O1;char* O2;char* O3;char* O4;char* O5;
char sbuf[20]={0},sbuf1[200]={0};
char N[12]={0};
uint8_t len,i;
for(i=0;i<5;i++)
{N[i*2+1]=num[i*2];N[i*2]=num[i*2+1];}
N[11]=num[10];N[10]='F';
SendAT_PrintBack( "AT+CMGF=0
", "OK", sizeof("AT+CMGF=0
"),100);
delay_ms(200);
strcat(sbuf,"AT+CMGS=35
");
SendAT_PrintBack( sbuf, ">", sizeof(sbuf),100);
delay_ms(200);
strcat(sbuf1,"0011000D9168");
strcat(sbuf1,N);
strcat(sbuf1,"00080014");
strcat(sbuf1,O1);strcat(sbuf1,O2);strcat(sbuf1,O3);strcat(sbuf1,O4);strcat(sbuf1,O5);
len=strlen(sbuf1);
sbuf1[len]=0x1a;
sbuf1[len+1]=0
}[/mw_shl_code]
当我进行单步调试时调试到strcat(sbuf1,N)时程序就进入死循环了,跳到这个死循环void HardFault_Handler(void),我感觉strcat函数用的没错啊,就是简单的链接字符串。实在没搞明白,求大神帮忙啊
全部放全局数组试试。
一周热门 更多>