• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ CLS1_GetStdio函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CLS1_GetStdio函数的典型用法代码示例。如果您正苦于以下问题:C++ CLS1_GetStdio函数的具体用法?C++ CLS1_GetStdio怎么用?C++ CLS1_GetStdio使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CLS1_GetStdio函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: APP_OnKeyPressed

void APP_OnKeyPressed(uint8_t keys) {
  if (keys&1) {
    CLS1_SendStr((uint8_t*)"SW3 pressed!\r\n", CLS1_GetStdio()->stdOut);
  } else if (keys&2) {
    CLS1_SendStr((uint8_t*)"SW2 pressed!\r\n", CLS1_GetStdio()->stdOut);
  }
}
开发者ID:gaosoc,项目名称:mcuoneclipse,代码行数:7,代码来源:Application.c


示例2: TestFlash

/**
 * \brief Method to test the flash chip.
 * @return void
 */
static void TestFlash(void) {
	uint8_t errCode;
	uint8_t test=55;
	uint8_t result=27;
	uint32_t testAddr=0x0000F300;
	uint8_t status=1;

	FLASH_Init();
	WAIT1_Waitms(1000);
	errCode = FLASH_ReadStatusReg(&status);
	if(errCode!=ERR_OK) {
		for(;;) {}
	}
	CLS1_SendStr((const unsigned char*)"\r\nStatus: ",CLS1_GetStdio()->stdOut);
	CLS1_SendNum16u(status,CLS1_GetStdio()->stdOut);
	for(;;) {}
	errCode = FLASH_WriteByte(testAddr,&test);
	if(errCode!=ERR_OK) {
		for(;;) {}
	}
	errCode = FLASH_ReadByte(testAddr,&result);
	if(errCode!=ERR_OK) {
		for(;;) {}
	}
	CLS1_SendStr((const unsigned char*)"\r\nOutput: ",CLS1_GetStdio()->stdOut);
	CLS1_SendNum16u(result,CLS1_GetStdio()->stdOut);
}
开发者ID:3ben1189,项目名称:mcuoneclipse,代码行数:31,代码来源:Application.c


示例3: APP_OnKeyReleasedLong

void APP_OnKeyReleasedLong(uint8_t keys) {
  if (keys&1) {
    CLS1_SendStr((uint8_t*)"SW3 long released!\r\n", CLS1_GetStdio()->stdOut);
  } else if (keys&2) {
    CLS1_SendStr((uint8_t*)"SW2 long released!\r\n", CLS1_GetStdio()->stdOut);
  }
}
开发者ID:gaosoc,项目名称:mcuoneclipse,代码行数:7,代码来源:Application.c


示例4: portTASK_FUNCTION

static portTASK_FUNCTION(ShellTask, pvParameters) {
#if PL_HAS_SD_CARD
  bool cardMounted = FALSE;
  static FAT1_FATFS fileSystemObject;
#endif
  unsigned char buf[48];

  (void)pvParameters; /* not used */
  buf[0] = '\0';
  (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable);
  for(;;) {
#if PL_HAS_SD_CARD
    (void)FAT1_CheckCardPresence(&cardMounted,
        0 /* volume */, &fileSystemObject, CLS1_GetStdio());
    if (cardMounted) {
      //SD_GreenLed_On();
      //SD_RedLed_Off();
    } else {
      //SD_GreenLed_Off();
      //SD_RedLed_On();
    }
#endif
    (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable);
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
    LEDG_Neg();
  }
}
开发者ID:dansog56,项目名称:mcuoneclipse,代码行数:27,代码来源:Shell.c


示例5: Radio_StdIOSendChar

static void Radio_StdIOSendChar(byte ch) {
#define TX_BUF_SIZE   (RADIO_MAX_TX_DATA_SIZE-sizeof("stdout ")) /* data size we can transmit in one message */
    unsigned char buf[TX_BUF_SIZE+sizeof("stdout ")];
    uint8_t i;

    CLS1_GetStdio()->stdOut(ch); /* copy on local shell */
    if (RadioTx_Put(ch)!=ERR_OK) {
        /* lost character */
    }
    if (ch=='\n' || RadioTx_NofElements()>TX_BUF_SIZE) { /* send string over radio */
        UTIL1_strcpy(buf, sizeof(buf), (unsigned char*)"stdout ");
        i = sizeof("stdout ")-1;
        while (i<sizeof(buf) && RadioTx_Get(&buf[i])==ERR_OK) {
            i++;
        }
        if (RADIO_SendData(buf, i)!=ERR_OK) {
            CLS1_GetStdio()->stdOut('\n');
            CLS1_GetStdio()->stdOut('*');
            CLS1_GetStdio()->stdOut('F');
            CLS1_GetStdio()->stdOut('A');
            CLS1_GetStdio()->stdOut('I');
            CLS1_GetStdio()->stdOut('L');
            CLS1_GetStdio()->stdOut('*');
            CLS1_GetStdio()->stdOut('\n');
        }
    }
}
开发者ID:julioefajardo,项目名称:mcuoneclipse,代码行数:27,代码来源:Shell.c


示例6: portTASK_FUNCTION

static portTASK_FUNCTION(ShellTask, pvParameters) {
  unsigned char buf[48];

  (void)pvParameters; /* not used */
  buf[0] = '\0';
  (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable);
  for(;;) {
    (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable);
    FRTOS1_vTaskDelay(pdMS_TO_TICKS(10));
  }
}
开发者ID:nikolarobottesla,项目名称:mcuoneclipse,代码行数:11,代码来源:Shell.c


示例7: portTASK_FUNCTION

static portTASK_FUNCTION(ShellTask, pvParameters) {
  unsigned char buf[32];

  (void)pvParameters; /* not used */
  buf[0] = '\0';
  (void)CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable);
  for(;;) {
    (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable);
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
    LEDG_Neg();
  }
}
开发者ID:IsidreSole,项目名称:mcuoneclipse,代码行数:12,代码来源:Shell.c


示例8: SHELL_Run

void SHELL_Run(void) {
  unsigned char buf[32];
  unsigned char bTbuf[32];
  
  buf[0]='\0';
  bTbuf[0]='\0';
  CLS1_ParseWithCommandTable((unsigned char*)CLS1_CMD_HELP, CLS1_GetStdio(), CmdParserTable);
  for(;;) {
    (void)CLS1_ReadAndParseWithCommandTable(buf, sizeof(buf), CLS1_GetStdio(), CmdParserTable);
    (void)CLS1_ReadAndParseWithCommandTable(bTbuf, sizeof(bTbuf), &BT_stdio, CmdParserTable);
  }
}
开发者ID:3ben1189,项目名称:mcuoneclipse,代码行数:12,代码来源:Shell.c


示例9: REF_Calibrate

void REF_Calibrate(bool start) {
  if (start) {
    isCalibrated = FALSE;
    REF_InitSensorValues();
    doMinMaxCalibration = TRUE;
    CLS1_SendStr((unsigned char*)"start calibration...\r\n", CLS1_GetStdio()->stdOut);
  } else {
    doMinMaxCalibration = FALSE;
    isCalibrated = TRUE;
    CLS1_SendStr((unsigned char*)"calibration stopped.\r\n", CLS1_GetStdio()->stdOut);
  }
}
开发者ID:sethj00,项目名称:mcuoneclipse,代码行数:12,代码来源:Reflectance.c


示例10: REF_DumpHistory

void REF_DumpHistory(void) {
  int i;
  unsigned char buf[16];
  
  CLS1_SendStr((unsigned char*)"history: #", CLS1_GetStdio()->stdOut);
  CLS1_SendNum16u(REF_nofHistory, CLS1_GetStdio()->stdOut);
  for (i=0;i<REF_NOF_SENSORS;i++) {
    CLS1_SendStr((unsigned char*)" 0x", CLS1_GetStdio()->stdOut);
    buf[0] = '\0'; UTIL1_strcatNum16Hex(buf, sizeof(buf), SensorHistory[i]);
    CLS1_SendStr(buf, CLS1_GetStdio()->stdOut);
  }
  CLS1_SendStr((unsigned char*)"\r\n", CLS1_GetStdio()->stdOut);
}
开发者ID:sethj00,项目名称:mcuoneclipse,代码行数:13,代码来源:Reflectance.c


示例11: WiznetSetup

static void WiznetSetup(void) {
  CLS1_SendStr((unsigned char*)"Reset W5100.\r\n", CLS1_GetStdio()->stdOut);
  /* reset device */
  if (W5100_MemWriteByte(W5100_MR, W5100_MR_BIT_RST)!=ERR_OK) {
    CLS1_SendStr((unsigned char*)"Failed to reset device!\r\n", CLS1_GetStdio()->stdErr);
  }
  CLS1_SendStr((unsigned char*)"Configure network.\r\n", CLS1_GetStdio()->stdOut);
  /* configure network: IP address, gateway, netmask, MAC */
  if (W5100_WriteConfig((w5100_config_t*)&W5100_config)!=ERR_OK) {
    CLS1_SendStr((unsigned char*)"Failed to set Net Configuration!\r\n", CLS1_GetStdio()->stdErr);
  }
  CLS1_SendStr((unsigned char*)"Configure RX/TX memory.\r\n", CLS1_GetStdio()->stdOut);
  /* we have 8 KByte we can use for the RX and TX sockets: */
  if (W5100_MemWriteByte(W5100_RMSR, 
       W5100_xMSR_SOCKET_1_MEM_SIZE_2KB
      |W5100_xMSR_SOCKET_2_MEM_SIZE_2KB
      |W5100_xMSR_SOCKET_3_MEM_SIZE_2KB
      |W5100_xMSR_SOCKET_4_MEM_SIZE_2KB
     )!=ERR_OK) 
  {
    CLS1_SendStr((unsigned char*)"Failed to set RX socket memory size!\r\n", CLS1_GetStdio()->stdErr);
  }
  if (W5100_MemWriteByte(W5100_TMSR, 
       W5100_xMSR_SOCKET_1_MEM_SIZE_2KB
      |W5100_xMSR_SOCKET_2_MEM_SIZE_2KB
      |W5100_xMSR_SOCKET_3_MEM_SIZE_2KB
      |W5100_xMSR_SOCKET_4_MEM_SIZE_2KB
     )!=ERR_OK) 
  {
    CLS1_SendStr((unsigned char*)"Failed to set TX socket memory size!\r\n", CLS1_GetStdio()->stdErr);
  }
  CLS1_SendStr((unsigned char*)"done!\r\n", CLS1_GetStdio()->stdOut);
}
开发者ID:AlexanderWiniger,项目名称:mcuoneclipse,代码行数:33,代码来源:Application.c


示例12: WriteUltraLight

static void WriteUltraLight(Uid *uid) {
  MFRC522_StatusCode status;
  uint8_t data[4] = {0x1, 0x2, 0x3, 0x4};

  PICC_Type piccType = MFRC522_PICC_GetType(uid->sak);
  if (piccType != PICC_TYPE_MIFARE_UL)  {
    CLS1_SendStr("Only works with MIFARE Ultralight cards!\r\n", CLS1_GetStdio()->stdErr);
    return;
  }
  status = MFRC522_MIFARE_Ultralight_Write(2, data, sizeof(data));
  if (status!=STATUS_OK) {
    CLS1_SendStr("Failed writing!\r\n", CLS1_GetStdio()->stdErr);
  }
}
开发者ID:jeffyoon,项目名称:mcuoneclipse,代码行数:14,代码来源:rfid.c


示例13: SHELL_SendString

void SHELL_SendString(unsigned char *msg) {
#if PL_CONFIG_HAS_SHELL_QUEUE
    SQUEUE_SendString(msg);
#else
    CLS1_SendStr(msg, CLS1_GetStdio()->stdOut);
#endif
}
开发者ID:danstadelmann,项目名称:INTRO_CW,代码行数:7,代码来源:Shell.c


示例14: APP_Run

void APP_Run(void) {
  DHTxx_ErrorCode res;
  uint16_t temperature, humidity;
  CLS1_ConstStdIOType *io = CLS1_GetStdio();
  uint8_t buf[48];

#if DHTxx_SENSOR_TYPE_IS_DHT11
  CLS1_SendStr("DHT11 Sensor Demo:\r\n", io->stdErr);
#else
  CLS1_SendStr("DHT22 Sensor Demo:\r\n", io->stdErr);
#endif
  WAIT1_Waitms(1000); /* wait one second after power-up to get the sensor stable */
  for(;;) {
    res = DHTxx_Read(&temperature, &humidity);
    if (res!=DHTxx_OK) { /* error */
      LEDR_Neg(); /* indicate error with red LED */
      /* write error message */
      CLS1_SendStr("ERROR: ", io->stdErr);
      CLS1_SendStr(DHTxx_GetReturnCodeString(res), io->stdErr);
      CLS1_SendStr("\r\n", io->stdErr);
    } else { /* ok! */
      LEDG_Neg();
      /* write data values */
      UTIL1_strcpy(buf, sizeof(buf), "Temperature ");
      UTIL1_strcatNum32sDotValue100(buf, sizeof(buf), (int32_t)temperature);
      UTIL1_strcat(buf, sizeof(buf), "°C, Humidity ");
      UTIL1_strcatNum32sDotValue100(buf, sizeof(buf), (int32_t)humidity);
      UTIL1_strcat(buf, sizeof(buf), "%\r\n");
      CLS1_SendStr(buf, io->stdOut);
    }
    WAIT1_Waitms(DHTxx_SENSOR_PERIOD_MS); /* can only read sensor values with a certain frequency! */
  }
}
开发者ID:ADeadCat,项目名称:mcuoneclipse,代码行数:33,代码来源:Application.c


示例15: portTASK_FUNCTION

static portTASK_FUNCTION(TraceTask, pvParameters) {
  static unsigned char buf[128]; /* global buffer, to reduce stack size. We want to send things in one piece */

  (void)pvParameters;
  for(;;) {
    if (traceChannel==TRACE_TO_NONE) {
      FRTOS1_vTaskDelay(1000/portTICK_RATE_MS);
    } else if (traceChannel==TRACE_TO_SHELL) {
      buf[0] = '\0';
      UTIL1_strcat(buf, sizeof(buf), (unsigned char*)" => ");
      if (traceAccel) {
        int16_t x, y, z;

        ACCEL_GetValues(&x, &y, &z);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)" X:");
        UTIL1_strcatNum16sFormatted(buf, sizeof(buf), x, ' ', 6);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"; Y:");
        UTIL1_strcatNum16sFormatted(buf, sizeof(buf), y, ' ', 6);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"; Z:");
        UTIL1_strcatNum16sFormatted(buf, sizeof(buf), z, ' ', 6);
        UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"\r\n");
        CLS1_SendStr(&buf[0], CLS1_GetStdio()->stdOut);
        FRTOS1_vTaskDelay(100/portTICK_RATE_MS);
      }
      FRTOS1_vTaskDelay(25/portTICK_RATE_MS);
    }
  }
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:28,代码来源:Trace.c


示例16: portTASK_FUNCTION

static portTASK_FUNCTION(Button, pvParameters) {
  CLS1_ConstStdIOType *io = CLS1_GetStdio();

  (void)pvParameters; /* parameter not used */
  for(;;) {
    /* check push button switch: turns on/off cooling immediately */
    if (SW2_GetVal()==0) { /* button pressed */
      FRTOS1_vTaskDelay(10/portTICK_RATE_MS); /* debounce */
      if (SW2_GetVal()==0) { /* still pressed */
        while(SW2_GetVal()==0) {
          /* wait until released */
          FRTOS1_vTaskDelay(10/portTICK_RATE_MS); /* debounce */
        }
        DisableScheduler(io);
        if (isPumpOn) { /* pump is on, toggle it */
          SetCooling(FALSE, io); /* turn cooling off */
          mySchedule.isSchedulerOn = TRUE; /* turn scheduler on again */
        } else {
          SetCooling(TRUE, io); /* turn cooling on */
        }
      }
    }
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
  } /* for */
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:25,代码来源:Hoval.c


示例17: HandleDataRxMessage

static uint8_t HandleDataRxMessage(RAPP_MSG_Type type, uint8_t size, uint8_t *data, RNWK_ShortAddrType srcAddr, bool *handled, RPHY_PacketDesc *packet) {
#if PL_HAS_SHELL
  uint8_t buf[32];
  CLS1_ConstStdIOTypePtr io = CLS1_GetStdio();
#endif
  uint8_t val;
  (void)size;
  (void)packet;
  switch(type) {
    case RAPP_MSG_TYPE_DATA: /* generic data message */
      *handled = TRUE;
      val = *data; /* get data value */
#if PL_HAS_DRIVE
      DRV_EnableDisable(TRUE);
#endif
#if PL_HAS_SHELL
      SHELL_SendString((unsigned char*)"Data: ");
      SHELL_SendString(data);
      SHELL_SendString((unsigned char*)" from addr 0x");
      buf[0] = '\0';
#if RNWK_SHORT_ADDR_SIZE==1
      UTIL1_strcatNum8Hex(buf, sizeof(buf), srcAddr);
#else
      UTIL1_strcatNum16Hex(buf, sizeof(buf), srcAddr);
#endif
      UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"\r\n");
      SHELL_SendString(buf);
#endif /* PL_HAS_SHELL */      
      return ERR_OK;
      break;
    default:
      break;
  } /* switch */
  return ERR_OK;
}
开发者ID:eiswasser,项目名称:Sumobotic,代码行数:35,代码来源:RNet_App.c


示例18: FlushAndTxQueue

/*!
 * \brief Flushes the given buffer/queue. The buffer will be sent over the radio.
 * \return Error code, ERR_OK for no error.
 */
static uint8_t FlushAndTxQueue(RSTDIO_QueueType queueType, RAPP_MSG_Type msgType) {
  unsigned char buf[RAPP_BUFFER_SIZE];
  uint8_t i;
  uint8_t res = ERR_OK;
  uint8_t *p, ch;
  
  p = RAPP_BUF_PAYLOAD_START(buf);
  i = 0;
  while (i<RAPP_PAYLOAD_SIZE) {
    ch = RSTDIO_ReceiveQueueChar(queueType);
    if (ch=='\0') { /* queue empty */
      break;
    }
    *p++ = ch;
    i++;
  }
  res = RAPP_PutPayload(buf, sizeof(buf), i, msgType, RSTDIO_dstAddr);
  if (res!=ERR_OK) {
    CLS1_ConstStdIOType *io = CLS1_GetStdio();

    io->stdErr('*');
    io->stdErr('F');
    io->stdErr('A');
    io->stdErr('I');
    io->stdErr('L');
    io->stdErr('*');
    io->stdErr('\n');
    return res;
  }
  return res;
}
开发者ID:IanScanlon,项目名称:mcuoneclipse,代码行数:35,代码来源:RStdIO.c


示例19: HandleDataRxMessage

static uint8_t HandleDataRxMessage(RAPP_MSG_Type type, uint8_t size, uint8_t *data, RNWK_ShortAddrType srcAddr, bool *handled, RPHY_PacketDesc *packet) {
#if PL_HAS_SHELL
  uint8_t buf[16];
  CLS1_ConstStdIOTypePtr io = CLS1_GetStdio();
#endif
  uint8_t val;
  
  (void)size;
  (void)packet;
  switch(type) {
    case RAPP_MSG_TYPE_DATA: /* <type><size><data */
      *handled = TRUE;
      val = *data; /* get data value */
#if PL_HAS_SHELL
      CLS1_SendStr((unsigned char*)"Data: ", io->stdOut);
      CLS1_SendNum8u(val, io->stdOut);
      CLS1_SendStr((unsigned char*)" from addr 0x", io->stdOut);
      buf[0] = '\0';
#if RNWK_SHORT_ADDR_SIZE==1
      UTIL1_strcatNum8Hex(buf, sizeof(buf), srcAddr);
#else
      UTIL1_strcatNum16Hex(buf, sizeof(buf), srcAddr);
#endif
      UTIL1_strcat(buf, sizeof(buf), (unsigned char*)"\r\n");
      CLS1_SendStr(buf, io->stdOut);
#endif      
      return ERR_OK;
    default:
      break;
  } /* switch */
  return ERR_OK;
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:32,代码来源:RNet_App.c


示例20: APP_Start

void APP_Start(void) {
  uint8_t val=0;
  uint8_t range, res;
  uint16_t ambient;
  CLS1_ConstStdIOType *io = CLS1_GetStdio();

  VL_Init(); /* initialize sensor driver */
  for(;;) {
    res = VL_ReadRangeSingle(&range);
    if (res!=ERR_OK) {
      CLS1_SendStr("ERROR Range: ", io->stdErr);
      CLS1_SendNum8u(res, io->stdErr);
    } else {
      CLS1_SendStr("Range: ", io->stdOut);
      CLS1_SendNum8u(range, io->stdOut);
    }
    res = VL_ReadAmbientSingle(&ambient);
    if (res!=ERR_OK) {
      CLS1_SendStr(" ERROR Ambient: ", io->stdErr);
      CLS1_SendNum8u(res, io->stdErr);
    } else {
      CLS1_SendStr(" Ambient: ", io->stdOut);
      CLS1_SendNum16u(ambient, io->stdOut);
    }
    CLS1_SendStr("\r\n", io->stdOut);
    LED1_Neg();
    WAIT1_Waitms(500);
  }
}
开发者ID:ADeadCat,项目名称:mcuoneclipse,代码行数:29,代码来源:Application.c



注:本文中的CLS1_GetStdio函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CLS1_SendHelpStr函数代码示例发布时间:2022-05-30
下一篇:
C++ CLR_INT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap