TI中文支持网
TI专业的中文技术问题搜集分享网站

CC1312R: RF_cmdPropRx 的callback 函数中调用UART_write问题

Part Number:CC1312R

char RX_PER[7] = {0xAA,0x55,0x03,0x09,0x00,0x00,0x55}; 

terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,
RF_PriorityNormal, &callback,
RF_EventRxEntryDone);

void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
if (e & RF_EventRxEntryDone)
{
R_Cnt++;

/* Get current unhandled data entry */
currentDataEntry = RFQueue_getDataEntry();

/* Handle the packet data, located at &currentDataEntry->data:
* – Length is the first byte with the current configuration
* – Data starts from the second byte */
packetLength = *(uint8_t*)(&currentDataEntry->data);
packetDataPointer = (uint8_t*)(&currentDataEntry->data + 1);

/* Copy the payload + the status byte to the packet variable */
memcpy(packet, packetDataPointer, (packetLength + 1));
RFQueue_nextEntry();
for(int j=0;j<7;j++)
{
UART_write(uart,&RX_PER[j],1); //问题:为什么这里只能打印出RX_PER[0]就停了?
}

}

}

问题1:使用RF_cmdPropRx时,接收到数据后进入callback函数,在callback函数中调用UART_write,只能执行一次,即for(int j=0;j<7;j++)
{
UART_write(uart,&RX_PER[j],1); 只打印出了0XAA。我要怎样才能实现打印出RX_PER数组;

问题2:怎样配置可以,退出RF_cmdPropRx,下次可以通过

terminationReason = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropRx,RF_PriorityNormal, &callback,RF_EventRxEntryDone);重新进入RF_cmdPropRx;

Kevin Qiu1:

参考这里类似的问题:https://e2echina.ti.com/support/wireless-connectivity/sub-1-ghz/f/sub-1-ghz-forum/204857/cc1310-rf_packetrx

赞(0)
未经允许不得转载:TI中文支持网 » CC1312R: RF_cmdPropRx 的callback 函数中调用UART_write问题
分享到: 更多 (0)