Tool/software: Code Composer Studio
We are using CCS v6 for the project.
The given Wake On Radio example for Rx section (rfWakeOnRadio_CC1310DK_7XD) is modified so the the blinking LED1 stays on and does not blink.
In the original example the board LED (LED1) blinks ON & OFF when a packet is available. But, we modified it so the LED1 stays ON when packets are available and would go OFF only when there is no packet and Tx stops sending anything. The code for that particular section is shown below.
So, my question is how to make LED1 to stay ON for an additional 5 seconds after there is no packet? We like to have LED1 to stay ON as long as there is a packet and stays ON for an additional 5 seconds after Tx stops sending any packet.
Any advice would be highly appreciated.
Here is the core from rfWakeOnRadio_CC1310DK_7XD example for Rx section and the simple modification to keep LED1 ON (and not toggling):
void callback(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
PIN_setOutputValue(ledPinHandle, Board_LED1, 0);
/* If we've received a new packet and it's available to read out */
if (e & RF_EventRxEntryDone)
{
do
{
/* Toggle LED1 on RX (The following line is Disabled) */
// PIN_setOutputValue(ledPinHandle, Board_LED1, !PIN_getOutputValue(Board_LED1));
/* Here the LED1 comes ON & stays ON if the new packet is available */
PIN_setOutputValue(ledPinHandle, Board_LED1, 1);
/* Get current unhandled data entry */
currentDataEntry = RFQueue_getDataEntry();
/* Handle the packet data, located at ¤tDataEntry->data:
* - Length is the first byte with the current configuration
* - Data starts from the second byte */
packetLength = *(uint8_t*)(¤tDataEntry->data);
packetDataPointer = (uint8_t*)(¤tDataEntry->data + 1);
/* This code block is added to avoid a compiler warning.
* Normally, an application will reference these variables for
* useful data. */
volatile uint8_t dummy;
dummy = packetLength;
dummy = dummy + packetDataPointer[0];
} while(RFQueue_nextEntry() == DATA_ENTRY_FINISHED);
}
}