多标签调试1
多标签最近调试了几天,但是一直进展不大。今天在代码中间加了一行串口打印,突然整个系统就可以正常运转了,两个标签测距,刷新频率在2HZ左右,而且很流畅。 当把打印语句删除,两个标签就不能工作了。记录一下,以后慢慢解决
for(tag_index = SLAVE_TAG_START_INDEX; tag_index <MAX_SLAVE_TAG; tag_index++)
{
if(Semaphore == 1)
{
printf("Release Semaphore to Tag%d!\r\n",tag_index);
// dwt_setrxtimeout(0);
Master_Release_Semaphore = 0;
Master_Release_Semaphore = tag_index;而且从串口信息看到,每次master tag 都会打印两次这个信息,有点异常
Tag1 In NetWork!
Release Semaphore to Tag1!
Release Semaphore to Tag1!
if (memcmp(rx_buffer, Master_Release_Semaphore, ALL_MSG_COMMON_LEN) == 0)
{
Master_Release_Semaphore_comfirm = frame_seq_nb;
Master_Release_Semaphore_comfirm = TAG_ID;
dwt_writetxdata(sizeof(Master_Release_Semaphore_comfirm), Master_Release_Semaphore_comfirm, 0);
dwt_writetxfctrl(sizeof(Master_Release_Semaphore_comfirm), 0);
dwt_starttx(DWT_START_TX_IMMEDIATE);问题原因在于接收到Master Release 信号后,发送答复没有等发送成功就开始测距,发送poll message了,在发送后加上等待发送完成标志位,系统运行起来比较正常了。
页:
[1]