예제 #1
0
static portTASK_FUNCTION(ShellTask, pvParameters) {
#if PL_HAS_BLUETOOTH
    static unsigned char bTbuf[48];
#endif
    CLS1_ConstStdIOTypePtr io = CLS1_GetStdio();
    static unsigned char cmd_buf[48];
#if PL_HAS_RADIO
    static unsigned char radio_cmd_buf[48];
#endif

    (void)pvParameters; /* not used */
#if PL_HAS_MAGNETOMETER
    LSM_Init(); /* need to do this while FreeRTOS tick is active, because of Timeout handling */
#endif
#if PL_HAS_BLUETOOTH
    bTbuf[0]='\0';
#endif
    cmd_buf[0] = '\0';
#if PL_HAS_RADIO
    radio_cmd_buf[0] = '\0';
#endif
    (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable);
    for(;;) {
        (void)CLS1_ReadAndParseWithCommandTable(cmd_buf, sizeof(cmd_buf), io, CmdParserTable);
#if PL_HAS_SHELL_CMD_I2C
        if (I2C_ReceiveCommand(cmd_buf, sizeof(cmd_buf))==ERR_OK) {
            (void)CLS1_ParseWithCommandTable(cmd_buf, io, CmdParserTable);
        }
#endif
#if PL_HAS_RADIO
        (void)CLS1_ReadAndParseWithCommandTable(radio_cmd_buf, sizeof(radio_cmd_buf), &Radio_stdio, CmdParserTable);
#endif
#if PL_HAS_BLUETOOTH
        (void)CLS1_ReadAndParseWithCommandTable(bTbuf, sizeof(bTbuf), &BT_stdio, CmdParserTable);
#endif
        HandleQueues(io);
#if PL_HAS_WATCHDOG
        WDT_IncTaskCntr(WDT_TASK_ID_SHELL, 50);
#endif
        FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
    } /* for */
}
예제 #2
0
static portTASK_FUNCTION(ShellTask, pvParameters) {
#if BT1_PARSE_COMMAND_ENABLED
  unsigned char bTbuf[48];
#endif
  unsigned char buf[48];

  (void)pvParameters; /* not used */
#if PL_HAS_MAGNETOMETER
  LSM_Init(); /* need to do this while FreeRTOS tick is active, because of Timeout handling */
#endif
  buf[0] = '\0';
#if BT1_PARSE_COMMAND_ENABLED
  bTbuf[0]='\0';
#endif
  (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable);
  for(;;) {
    (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable);
#if BT1_PARSE_COMMAND_ENABLED
    (void)CLS1_ReadAndParseWithCommandTable(bTbuf, sizeof(bTbuf), &BT_stdio, CmdParserTable);
#endif
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
  }
}