void S2EIntHandler(void){
unsigned long tdata;
struct tcp_pcb *PCBSend;
static unsigned char SERIALCMD[200]={0,};
PCBSend=g_psPCB2;
tdata=GETFlag();
if(2==tdata){
GETSERIALCMD(SERIALCMD);
tcp_sent(PCBSend, NULL);
tcp_write(PCBSend,SERIALCMD,strlen(SERIALCMD),0);
tcp_output(PCBSend);
SETFlag(0);
}
}
void
lwIPHostTimerHandler(void)
{
......
S2EIntHandler();
......
}
我加到lwIPHostTimerHandler里来发送了 100ms判断一次