Hi,
in the rtPacketTx example everything works when RF_cmdPropTx.startTime is incremented by PACKET_INTERVAL, 500ms. But when interval gets smaller, the operation fails. Here is the snipped of code from the CCS example project.
The only difference - the current time is read before the command is run, and the delay is set to 1000 RTC ticks (about 250us) instead of PACKET_INTERVAL (500ms). At a longer dealy, say 3000 ticks, everything starts working.
Does anyone have an idea why?
Cheers!
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();
}
time = RF_getCurrentTime(); // added by me
/* Set absolute TX time to utilize automatic power management */
time += 1000; //PACKET_INTERVAL; - modified by me
RF_cmdPropTx.startTime = time;
/* Send packet */
RF_EventMask result = RF_runCmd(rfHandle, (RF_Op*)&RF_cmdPropTx, RF_PriorityNormal, NULL, 0);
if (!(result & RF_EventLastCmdDone))
{
/* Error */
while(1);
}
PIN_setOutputValue(pinHandle, Board_LED1,!PIN_getOutputValue(Board_LED1));
}