Exemplo n.º 1
0
static portTASK_FUNCTION(ShellTask, pvParameters) {
  unsigned char cmd_buf[32];

  (void)pvParameters;
  FSSH1_Init();
  cmd_buf[0] = '\0';
  (void)FSSH1_ParseCommand((const unsigned char*)FSSH1_CMD_HELP, FSSH1_GetStdio(), ParseCommand); 
  for(;;) {
    (void)FSSH1_ReadAndParseLine(cmd_buf, sizeof(cmd_buf), FSSH1_GetStdio(), ParseCommand /* local cmd parser */);
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
    LED2_Neg();
  }
}
Exemplo n.º 2
0
static portTASK_FUNCTION(ShellTask, pvParameters) {
  static unsigned char cmd_buf[48];

  (void)pvParameters;
  (void)FSSH1_ParseCommand((unsigned char*)FSSH1_CMD_HELP, FSSH1_GetStdio(), ParseCommand); /* print help and prints as well the prompt */
  cmd_buf[0] = '\0';
  for(;;) {
#if PL_USE_USB_SCI
    static char_t usb_tx_buf[USB1_DATA_BUFF_SIZE];
    (void)CDC1_App_Task(usb_tx_buf, sizeof(usb_tx_buf)); /* Call the USB application task */
#endif
    (void)FSSH1_ReadAndParseLine(cmd_buf, sizeof(cmd_buf), FSSH1_GetStdio(), ParseCommand);
#if PL_HAS_QUEUE
  #if QUEUE_SINGLE_CHAR
    {
      unsigned char ch;
      FSSH1_StdIO_OutErr_FctType io = FSSH1_GetStdio()->stdOut;

      while((ch=QUEUE_ReceiveChar()) && ch!='\0') {
        io(ch);
      }
    }
  #else
    {
      const unsigned char *msg;

      msg = QUEUE_ReceiveMessage();
      if (msg!=NULL) {
        FSSH1_SendStr(msg, FSSH1_GetStdio()->stdOut);
        FRTOS1_vPortFree((void*)msg);
      }
    }
  #endif
#endif
#if PL_HAS_I2C
    if (SHELL_i2Commands && I2C_ReceiveCommand(cmd_buf, sizeof(cmd_buf))==ERR_OK) {
      bool handled = FALSE;

      (void)ParseCommand(cmd_buf, &handled, FSSH1_GetStdio());
    }
#endif
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
  }
}
Exemplo n.º 3
0
void SHELL_ParseLine(const unsigned char *cmd) {
  (void)FSSH1_ParseCommand(cmd, FSSH1_GetStdio(), ParseCommand); /* print help and prints as well the prompt */
}