如题,利用tirtos_cc13xx_cc26xx_2_21_00_06例程中RF packetTx进行发射测试,例程中
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams);
RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);
其中RF_cmdPropRadioDivSetup、RF_cmdPropTx这些在新生成的smartrf_settings.c文件中变成了RF_cmdRadioSetup、RF_cmdIeeeTx,我把程序改成这样:
static void txTaskFunction(UArg arg0, UArg arg1)
{
uint32_t time;
RF_Params rfParams;
RF_Params_init(&rfParams);
RF_cmdIeeeTx.payloadLen = PAYLOAD_LENGTH;
RF_cmdIeeeTx.pPayload = packet;
// RF_cmdIeeeTx.startTrigger.triggerType = TRIG_ABSTIME;
// RF_cmdIeeeTx.startTrigger.pastTrig = 1;
RF_cmdIeeeTx.startTime = 0;
/* Request access to the radio */
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdRadioSetup, &rfParams);
/* Set the frequency */
`RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
/* Get current time */
time = RF_getCurrentTime();
while(1)
{
/* Create packet with incrementing sequence number and random payload */
packet[0] = (uint8_t)(seqNumber >> 8);
packet[1] = (uint8_t)(seqNumber++);
uint8_t i;
for (i = 2; i < PAYLOAD_LENGTH; i++)
{
packet[i] = rand();
}
/* Set absolute TX time to utilize automatic power management */
time += PACKET_INTERVAL;
RF_cmdIeeeTx.startTime = time;
/* Send packet */
RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);
if (!(result & RF_EventLastCmdDone))
{
/* Error */
while(1);
}
PIN_setOutputValue(pinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));
}
}
最后程序总是死在RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdIeeeTx, RF_PriorityNormal, NULL, 0);过不去
求解答,一直用的cc2530走私有协议,刚接触cc2650,不是很懂。折腾了几天了