static portTASK_FUNCTION(MainTask, pvParameters) { (void)pvParameters; /* not used */ #if PL_HAS_TSS Configure(); /* initialize TSS library */ #endif for(;;) { #if PL_HAS_TSS TSS_Task(); /* call TSS library to process touches */ #else CheckButton(); #endif #if PL_APP_FOLLOW_OBSTACLE FollowObstacle(); #endif #if PL_HAS_LED_BLUE LEDB_Neg(); #endif #if PL_HAS_RADIO (void)RADIO_Handle(); #endif #if PL_HAS_EVENTS EVNT_HandleEvent(RADIO_AppHandleEvent); #endif StateMachine(FALSE); FRTOS1_vTaskDelay(10/portTICK_RATE_MS); } }
void RADIO_Init(void) { (void)SMAC1_MLMESetMC13192ClockRate(0); /* Set initial Clk speed from transceiver (CLKO)*/ RADIO_SetChannel(RADIO_Channel); /* Set channel */ RADIO_SetOutputPower(15); /* Set output power */ /*Initialize the packet */ RADIO_TxPacket.u8DataLength = 0; /* Set TX default length to 0 */ RADIO_TxPacket.pu8Data = &RADIO_TxDataBuffer[0]; /* Load the address of our txbuffer into the tx structure */ RADIO_RxPacket.u8DataLength = 0; /* Set RX default to 0*/ RADIO_RxPacket.pu8Data = &RADIO_RxDataBuffer[0]; /* Load the address of our rxbuffer into rx structure */ RADIO_RxPacket.u8MaxDataLength = 24; /* Define the max buffer we are interested in */ RADIO_RxPacket.u8Status = TRSVR1_INITIAL_VALUE; /* initialize the status packet to 0 */ RADIO_AppStatus = RADIO_INITIAL_STATE; /* Set the initial status of the application state variable */ /* create data queue */ #if 0 RADIO_MsgQueue = FRTOS1_xQueueCreate(RADIO_QUEUE_NOF_ITEMS, RADIO_QUEUE_ITEM_SIZE); if (RADIO_MsgQueue==NULL) { /* queue creation failed! */ for(;;) {} /* not enough memory? */ } #else for(;;) { RADIO_Handle(); } #endif }