static portTASK_FUNCTION(RadioTask, pvParameters) { (void)pvParameters; /* not used */ (void)RADIO_PowerUp(); for(;;) { (void)RADIO_Process(); FRTOS1_vTaskDelay(5/portTICK_RATE_MS); } }
void vRemoteTask(void* pvParameters) { (void)pvParameters; /* not used */ (void)RADIO_PowerUp(); for(;;) { (void)RADIO_Process(); RTOS_Wait(5); } }
static void RadioPowerUp(void) { /* need to ensure that we wait at least 100 ms (I use 150 ms here) after power-on of the transceiver */ portTickType xTime; xTime = FRTOS1_xTaskGetTickCount(); if (xTime<(150/portTICK_RATE_MS)) { /* not powered for 100 ms: wait until we can access the radio transceiver */ xTime = (150/portTICK_RATE_MS)-xTime; /* remaining ticks to wait */ FRTOS1_vTaskDelay(xTime); } (void)RADIO_PowerUp(); /* enable the transceiver */ }
/* ** =================================================================== ** Method : RNET1_PowerUp (component RNet) ** Description : ** Initializes and powers the radio up. ** Parameters : None ** Returns : ** --- - Error code ** =================================================================== */ uint8_t RNET1_PowerUp(void) { return RADIO_PowerUp(); }