|
发送程序在这里出现了死循环不往下执行了 有大哥知道原因吗(while (!(dwt_read32bitreg(SYS_STATUS_ID) & SYS_STATUS_TXFRS)){})
下面的是代码
int example_application_entry(void)
{
reset_DW1000();
spi_set_rate_low();
if (dwt_initialise(DWT_LOADNONE) == DWT_ERROR)
{
printf("INIT FAILED\r\n");
while (1)
{ }
}
printf("INIT SUCCESSED!\r\n");
printf("SET SPIRATE\r\n");
spi_set_rate_high();
printf("SPIRATE SET HIGH\r\n");
dwt_configure(&config);
while(1)
{
dwt_writetxdata(sizeof(tx_msg), tx_msg, 0);
dwt_writetxfctrl(sizeof(tx_msg), 0);
printf("TXDATA WRITE SUCCESSED\r\n");
dwt_starttx(DWT_START_TX_IMMEDIATE);
printf("ready to send\r\n");
txflag = dwt_read32bitreg(SYS_STATUS_ID);
txflag1 = SYS_STATUS_TXFRS;
while(!(txflag & txflag1))
{
}
printf("SEND SUCCESSED!\r\n");
dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_TXFRS);
HAL_Delay (TX_DELAY_MS);
tx_msg[BLINK_FRAME_SN_IDX]++;
}
}
|
|