Пример #1
0
/*
 * Variables globales
 * */
void vInicializar_globales(){
	xSem_OK = xSemaphoreCreateBinary();
	xSem_Fin_mov = xSemaphoreCreateBinary();
	xCola_mov = FRTOS1_xQueueCreate(MAX_MOVIMIENTOS, sizeof(uint8));
	xCola_US = FRTOS1_xQueueCreate(1, sizeof(portCHAR));
	sensar = FALSE;
	distancia_objeto = 999;
}
Пример #2
0
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
}
Пример #3
0
void SQUEUE_Init(void) {
  SQUEUE_Queue = FRTOS1_xQueueCreate(SQUEUE_LENGTH, SQUEUE_ITEM_SIZE);
  if (SQUEUE_Queue==NULL) {
    for(;;){} /* out of memory? */
  }
  FRTOS1_vQueueAddToRegistry(SQUEUE_Queue, "ShellQueue");
}
Пример #4
0
void RSTDIO_Init(void) {
  RSTDIO_dstAddr = RNWK_ADDR_BROADCAST;
  RSTDIO_RxStdInQ = FRTOS1_xQueueCreate(RSTDIO_QUEUE_LENGTH, RSTDIO_QUEUE_ITEM_SIZE);
  if (RSTDIO_RxStdInQ==NULL) {
    for(;;){} /* out of memory? */
  }
  RSTDIO_RxStdOutQ = FRTOS1_xQueueCreate(RSTDIO_QUEUE_LENGTH, RSTDIO_QUEUE_ITEM_SIZE);
  if (RSTDIO_RxStdOutQ==NULL) {
    for(;;){} /* out of memory? */
  }
  RSTDIO_RxStdErrQ = FRTOS1_xQueueCreate(RSTDIO_QUEUE_LENGTH, RSTDIO_QUEUE_ITEM_SIZE);
  if (RSTDIO_RxStdErrQ==NULL) {
    for(;;){} /* out of memory? */
  }
  RSTDIO_TxStdInQ = FRTOS1_xQueueCreate(RSTDIO_QUEUE_LENGTH, RSTDIO_QUEUE_ITEM_SIZE);
  if (RSTDIO_TxStdInQ==NULL) {
    for(;;){} /* out of memory? */
  }
  RSTDIO_TxStdOutQ = FRTOS1_xQueueCreate(RSTDIO_QUEUE_LENGTH, RSTDIO_QUEUE_ITEM_SIZE);
  if (RSTDIO_TxStdOutQ==NULL) {
    for(;;){} /* out of memory? */
  }
  RSTDIO_TxStdErrQ = FRTOS1_xQueueCreate(RSTDIO_QUEUE_LENGTH, RSTDIO_QUEUE_ITEM_SIZE);
  if (RSTDIO_TxStdErrQ==NULL) {
    for(;;){} /* out of memory? */
  }
#if PL_HAS_RTOS_TRACE
  RTOSTRC1_vTraceSetQueueName(RSTDIO_RxStdInQ,  "RxStdIn");
  RTOSTRC1_vTraceSetQueueName(RSTDIO_RxStdOutQ, "RxStdOut");
  RTOSTRC1_vTraceSetQueueName(RSTDIO_RxStdErrQ, "RxStdErr");
  RTOSTRC1_vTraceSetQueueName(RSTDIO_TxStdInQ,  "TxStdIn");
  RTOSTRC1_vTraceSetQueueName(RSTDIO_TxStdOutQ, "TxStdOut");
  RTOSTRC1_vTraceSetQueueName(RSTDIO_TxStdErrQ, "TxStdErr");
#endif
}
Пример #5
0
void I2C_Init(void) {
#if PL_IS_I2C_MASTER
  I2C1_SetMode(TRUE); /* master mode */
#elif PL_IS_I2C_SLAVE
  I2C1_SetMode(FALSE); /* slave mode */
#endif
#if PL_HAS_RUNNER
  I2C_RunnerQueue = FRTOS1_xQueueCreate(I2C_RUNNER_MSG_QUEUE_LENGTH, I2C_Runner_MSG_QUEUE_ITEM_SIZE); /* create Communication queue */
  if (I2C_RunnerQueue==NULL) {
    for(;;) {} /* out of memory? */
  }
#endif
}
Пример #6
0
void QUEUE_Init(void) {
  QUEUE_StdIn = FRTOS1_xQueueCreate(QUEUE_LENGTH, QUEUE_ITEM_SIZE);
#if PL_HAS_RTOS_TRACE
  Ptrc1_vTraceSetQueueName(QUEUE_StdIn, "ShellStdIn");
#endif
  if (QUEUE_StdIn==NULL) {
    for(;;){} /* out of memory? */
  }
  QUEUE_StdOut = FRTOS1_xQueueCreate(QUEUE_LENGTH, QUEUE_ITEM_SIZE);
#if PL_HAS_RTOS_TRACE
  Ptrc1_vTraceSetQueueName(QUEUE_StdOut, "ShellStdOut");
#endif
  if (QUEUE_StdOut==NULL) {
    for(;;){} /* out of memory? */
  }
  QUEUE_StdErr = FRTOS1_xQueueCreate(QUEUE_LENGTH, QUEUE_ITEM_SIZE);
#if PL_HAS_RTOS_TRACE
  Ptrc1_vTraceSetQueueName(QUEUE_StdErr, "ShellStdErr");
#endif
  if (QUEUE_StdErr==NULL) {
    for(;;){} /* out of memory? */
  }
}
Пример #7
0
void DRV_Init(void) {
  DRV_Status.mode = DRV_MODE_NONE;
  DRV_Status.speed.left = 0;
  DRV_Status.speed.right = 0;
  DRV_Status.pos.left = 0;
  DRV_Status.pos.right = 0;
  DRV_Queue = FRTOS1_xQueueCreate(QUEUE_LENGTH, QUEUE_ITEM_SIZE);
  if (DRV_Queue==NULL) {
    for(;;){} /* out of memory? */
  }
  FRTOS1_vQueueAddToRegistry(DRV_Queue, "Drive");
  if (FRTOS1_xTaskCreate(DriveTask, "Drive", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+3, NULL) != pdPASS) {
    for(;;){} /* error */
  }
}