Other Parts Discussed in Thread: SYSCONFIG
When using the rfPacketTx routine, I discovered an issue. I set a wake-up time of 1 second, and after waking up, data will be automatically sent. However, there is a possibility that this data may not be sent.
Below is my code for this part, along with a picture of the issue.
// void tx_cfg(void) { /* Initialize and open RCL */ RCL_init(); Display_init(); display = Display_open(Display_Type_UART, NULL); rclHandle = RCL_open(&rclClient, &LRF_config); /* Set RF frequency */ rclPacketTxCmdGenericTx.rfFrequency = FREQUENCY_chl37; /* Start command as soon as possible */ rclPacketTxCmdGenericTx.common.scheduling = RCL_Schedule_Now; rclPacketTxCmdGenericTx.common.status = RCL_CommandStatus_Idle; rclPacketTxCmdGenericTx.config.fsOff = FS_OFF; // Turn off FS /* Callback triggers on last command done */ rclPacketTxCmdGenericTx.common.runtime.callback = txCallback; rclPacketTxCmdGenericTx.common.runtime.rclCallbackMask.value = RCL_EventLastCmdDone.value; } void tx_service(void) { uint8_t *txData; RCL_Buffer_TxBuffer *txPacket = (RCL_Buffer_TxBuffer *)&packet_t; txData = RCL_TxBuffer_init(txPacket, 0, 0, 25); sendbuf_debug[24] = packet_cnt; /* Generate a random payload */ memcpy(txData,sendbuf_debug,25); /* Set packet to transmit */ RCL_TxBuffer_put(&rclPacketTxCmdGenericTx.txBuffers, txPacket); rclPacketTxCmdGenericTx.common.status = RCL_CommandStatus_Idle; /* Submit command */ RCL_Command_submit(rclHandle, &rclPacketTxCmdGenericTx); /* Pend on command completion */ RCL_Command_pend(&rclPacketTxCmdGenericTx); if(send_cnt>=3) { send_cnt = 0; packet_cnt++; usleep(PACKET_INTERVAL); } }