Exemple #1
0
void QUEUE_SendString(xQueueHandle queue, const unsigned char *str) {
  while(*str!='\0') {
    if (FRTOS1_xQueueSendToBack(queue, str, portMAX_DELAY)!=pdPASS) {
      for(;;){} /* ups? */
    }
    str++;
  }
}
Exemple #2
0
void SQUEUE_SendString(const unsigned char *str) {
  while(*str!='\0'){
	  if(FRTOS1_xQueueSendToBack(SQUEUE_Queue, str, 100/portTICK_RATE_MS) != pdPASS){
		  //loosing carcter!!
	  }
	  str++;
  }
}
Exemple #3
0
void QUEUE_SendData(xQueueHandle queue, const unsigned char *data, size_t dataSize) {
  while(dataSize!=0) {
    if (FRTOS1_xQueueSendToBack(queue, data, portMAX_DELAY)!=pdPASS) {
      for(;;){} /* ups? */
    }
    data++;
    dataSize--;
  }
}
Exemple #4
0
/*!
 * \brief Adds binary data to the queue.
 * \param queue Queue to be used
 * \param data Pointer to the binary data
 * \param dataSize Size of data in bytes
 */
static uint8_t AddToQueue(xQueueHandle queue, const unsigned char *data, size_t dataSize) {
  while(dataSize!=0) {
    if (FRTOS1_xQueueSendToBack(queue, data, RSTDIO_QUEUE_TIMEOUT_MS/portTICK_RATE_MS)!=pdPASS) {
      return ERR_FAULT;
    }
    data++;
    dataSize--;
  }
  return ERR_OK;
}
Exemple #5
0
uint8_t DRV_SetMode(DRV_Mode mode) {
  DRV_Command cmd;

  cmd.cmd = DRV_SET_MODE;
  cmd.u.mode = mode;
  if (FRTOS1_xQueueSendToBack(DRV_Queue, &cmd, portMAX_DELAY)!=pdPASS) {
    return ERR_FAILED;
  }
  FRTOS1_taskYIELD(); /* yield so drive task has a chance to read message */
  return ERR_OK;
}
Exemple #6
0
void SQUEUE_SendString(const unsigned char *str) {
  /*! \todo Implement function */
#if PL_CONFIG_HAS_SQUEUE_SINGLE_CHAR
  while(*str!='\0') {
    if (FRTOS1_xQueueSendToBack(SQUEUE_Queue, str, 100/portTICK_RATE_MS)!=pdPASS) {
      /*for(;;){}*/ /* ups? */ /* loosing character */
    }
    str++;
  }
#else
  unsigned char *ptr;
  size_t bufSize;

  bufSize = UTIL1_strlen(str)+1;
  ptr = FRTOS1_pvPortMalloc(bufSize);
  UTIL1_strcpy(ptr, bufSize, str);
  if (FRTOS1_xQueueSendToBack(SQUEUE_Queue, &ptr, portMAX_DELAY)!=pdPASS) {
    for(;;){} /* ups? */
  }
#endif
}
Exemple #7
0
uint8_t DRV_SetPos(int32_t left, int32_t right) {
  DRV_Command cmd;

  cmd.cmd = DRV_SET_POS;
  cmd.u.pos.left = left;
  cmd.u.pos.right = right;
  if (FRTOS1_xQueueSendToBack(DRV_Queue, &cmd, portMAX_DELAY)!=pdPASS) {
    return ERR_FAILED;
  }
  FRTOS1_taskYIELD(); /* yield so drive task has a chance to read message */
  return ERR_OK;
}