在 LRWPAN_CONFIG_H文件里面定义的定时器中断
#define LRWPAN_ENABLE_SLOW_TIMER
#define SLOWTICKS_PER_SECOND 10 //定义的时间,隔一段事件促发一次事件。
例如:
//called when the slow timer interrupt occurs
#ifdef LRWPAN_ENABLE_SLOW_TIMER
void usrSlowTimerInt(void ) {
BYTE c=0;
int count=0;
char string[100]="";
do{
c = halGetch();
string[count++]=c;
//halPutch(c);
}while(c!='*');
conPrintString(string);
}
#endif
这段代码每隔一段时间检查是否有从串口传来的数据,然后把数据存在数组里,最后输出。