void RMT_Init() { #ifdef G13_HAS_REMOTE RSTACK_Init(); /* initialize stack */ if (RAPP_SetMessageHandlerTable(handlerTable)!=ERR_OK) { /* assign application message handler */ for(;;){} /* error */ } if (RAPP_SetThisNodeAddr(RNWK_ADDR_BROADCAST)!=ERR_OK) { /* set a default address */ for(;;){} /* error */ } RTOS_AddTask(vRemoteTask, "RemoteTask"); #endif }
void RNETA_Init(void) { RSTACK_Init(); /* initialize stack */ if (RAPP_SetMessageHandlerTable(handlerTable)!=ERR_OK) { /* assign application message handler */ for(;;); /* "ERR: failed setting message handler!" */ } if (FRTOS1_xTaskCreate( RNetTask, /* pointer to the task */ "RNet", /* task name for kernel awareness debugging */ configMINIMAL_STACK_SIZE, /* task stack size */ (void*)NULL, /* optional task startup argument */ tskIDLE_PRIORITY, /* initial priority */ (xTaskHandle*)NULL /* optional task handle to create */ ) != pdPASS) { /*lint -e527 */ for(;;){}; /* error! probably out of memory */ /*lint +e527 */ } }
static portTASK_FUNCTION(MainTask, pvParameters) { #if PL_HAS_SHELL static unsigned char localConsole_buf[48]; #endif #if PL_HAS_RSTDIO static unsigned char radio_cmd_buf[48]; CLS1_ConstStdIOType *ioRemote = RSTDIO_GetStdioRx(); #endif #if PL_HAS_RSTDIO || PL_HAS_SHELL CLS1_ConstStdIOTypePtr ioLocal = CLS1_GetStdio(); #endif #if PL_HAS_RSTDIO radio_cmd_buf[0] = '\0'; #endif #if PL_HAS_SHELL localConsole_buf[0] = '\0'; CLS1_SendStr((unsigned char*)"nRF24L01+ Demo\r\n", ioLocal->stdOut); #endif RSTACK_Init(); /* initialize stack */ if (RAPP_SetMessageHandlerTable(handlerTable)!=ERR_OK) { /* assign application message handler */ Err((unsigned char*)"Failed setting message handler!\r\n"); } if (RAPP_SetThisNodeAddr(RNWK_ADDR_BROADCAST)!=ERR_OK) { /* set a default address */ Err((unsigned char*)"Failed setting source address!\r\n"); } #if PL_HAS_SHELL (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, ioLocal, CmdParserTable); #endif for(;;) { #if PL_HAS_SHELL (void)CLS1_ReadAndParseWithCommandTable(localConsole_buf, sizeof(localConsole_buf), ioLocal, CmdParserTable); #endif #if PL_HAS_RSTDIO RSTDIO_Print(ioLocal); /* handle stdout/stderr messages coming in */ (void)CLS1_ReadAndParseWithCommandTable(radio_cmd_buf, sizeof(radio_cmd_buf), ioRemote, CmdParserTable); #endif LED1_Neg(); FRTOS1_vTaskDelay(10/portTICK_RATE_MS); } }
void RNETA_Init(void) { RSTACK_Init(); /* initialize stack */ if (RAPP_SetMessageHandlerTable(handlerTable)!=ERR_OK) { /* assign application message handler */ for(;;){} /* error */ } if (RAPP_SetThisNodeAddr(RNWK_ADDR_BROADCAST)!=ERR_OK) { /* set a default address */ for(;;){} /* error */ } if (FRTOS1_xTaskCreate( RadioTask, /* pointer to the task */ "Radio", /* task name for kernel awareness debugging */ configMINIMAL_STACK_SIZE, /* task stack size */ (void*)NULL, /* optional task startup argument */ tskIDLE_PRIORITY+1, /* initial priority */ (xTaskHandle*)NULL /* optional task handle to create */ ) != pdPASS) { /*lint -e527 */ for(;;){}; /* error! probably out of memory */ /*lint +e527 */ } }
/* ** =================================================================== ** Method : RNET1_Init (component RNet) ** Description : ** Initializes the RNet Stack ** Parameters : None ** Returns : Nothing ** =================================================================== */ void RNET1_Init(void) { RSTACK_Init(); }