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

C++ putsUART函数代码示例

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

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



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

示例1: WF_AssertionFailed

void WF_AssertionFailed(UINT8 moduleNumber, UINT16 lineNumber) 
{
    #if defined(STACK_USE_UART)
    char buf[8];
    
    putrsUART("WF ASSERTION: Module Number = ");
    
    sprintf(buf, "%d  ", moduleNumber);
    putsUART(buf);
    
    putrsUART("Line Number = ");
    
    sprintf(buf, "%d", lineNumber);
    putsUART(buf);
    #endif
    
    #if defined(USE_LCD)
    {
        char buf[] = {WIFI_ASSERT_STRING};
        memset(LCDText, ' ', sizeof(LCDText));
        memcpy((void *)LCDText, (void *)buf, strlen(buf));
        uitoa(moduleNumber, (BYTE*)buf);
        memcpy((void *)&LCDText[18], (void *)buf, strlen(buf));
        LCDText[23] = 'L';
        LCDText[24] = ':';
        uitoa(lineNumber, &LCDText[25]);
        LCDUpdate();
    }    
    #endif

    
    while(1);
}    
开发者ID:OptecInc,项目名称:FocusLynxWiFiModuleFW,代码行数:33,代码来源:WF_Config.c


示例2: printStatus

void printStatus(STATUS *st)
{
	sprintf(outBuf,"\r\n\r\nDI:%u",st->heading);
	putsUART(outBuf);
	sprintf(outBuf,"\r\nLO:%u",st->location);
	putsUART(outBuf);
	sprintf(outBuf,"\r\nOC:%u",st->obzEntrCnt);
	putsUART(outBuf);
}
开发者ID:rushipatel,项目名称:ANTZ,代码行数:9,代码来源:antz.c


示例3: iwconfigGetMacStats

BOOL iwconfigGetMacStats(void)
{
    tWFMacStats my_WFMacStats;
    WF_GetMacStats(&my_WFMacStats);

    putsUART("MibRxMICFailureCounts = ");
    {
        char buf_t[16];
        sprintf(buf_t,"%u",(unsigned int)(my_WFMacStats.MibRxMICFailureCtr));
        putsUART(buf_t);
    }
    //putsUART("\r\n");
    return TRUE;
}
开发者ID:cnkker,项目名称:Microchip,代码行数:14,代码来源:WFConsoleIwconfig.c


示例4: CursorRight_N

/*= CursorRight_N ==============================================================
Purpose: Moves the cursor left N characters to the right

Inputs:  n -- number of characters to move the cursor to the left

         Note: This sequence only takes a single digit of length, so may need to
               do the move in steps


Returns: none
============================================================================*/
void CursorRight_N(UINT8 n)
{
   INT8 sequence_string[sizeof(cursorRightEscapeSequence) + 2];  /* null and extra digit */

//   ASSERT(n <= (strlen(g_ConsoleContext.buf) + CMD_LINE_PROMPT_LENGTH));

   if (n > 0u)
   {
      SET_CURSOR( GET_CURSOR() + n );
      sequence_string[0] = cursorRightEscapeSequence[0]; /* ESC */
      sequence_string[1] = cursorRightEscapeSequence[1];  /* '[' */

      if (n < 10u)
      {
         sequence_string[2] = n + '0';  /* ascii digit */
         sequence_string[3] = cursorRightEscapeSequence[3];    /* 'C' */
         sequence_string[4] = '\0';
      }
      else
      {
         sequence_string[2] = (n / 10) + '0';  /* first ascii digit  */
         sequence_string[3] = (n % 10) + '0';  /* second ascii digit */
         sequence_string[4] = cursorRightEscapeSequence[3];    /* 'C' */
         sequence_string[5] = '\0';

      }

      putsUART( (char *) sequence_string);
   }
}
开发者ID:Bobeye,项目名称:cta2045-wifi-modules,代码行数:41,代码来源:WFConsole.c


示例5: RawSetByte

/*****************************************************************************
 * FUNCTION: RawSetByte
 *
 * RETURNS: None
 *
 * PARAMS:
 *      rawId   - RAW ID
 *      pBuffer - Buffer containing bytes to write
 *      length  - number of bytes to read
 *
 *  NOTES: Writes bytes to RAW window
 *****************************************************************************/
void RawSetByte(UINT16 rawId, UINT8 *pBuffer, UINT16 length)
{
    UINT8 regId;
#if defined(OUTPUT_RAW_TX_RX)
    UINT16 i;
#endif    


    /* if previously set index past legal range and now trying to write to RAW engine */
    if ( (rawId == 0) && g_rxIndexSetBeyondBuffer && (GetRawWindowState(RAW_TX_ID) == WF_RAW_DATA_MOUNTED) )
    {
//        WF_ASSERT(FALSE);  /* attempting to write past end of RAW window */
    }

    /* write RAW data to chip */
    regId = (rawId==RAW_ID_0)?RAW_0_DATA_REG:RAW_1_DATA_REG;
    WriteWFArray(regId, pBuffer, length);

#if defined(OUTPUT_RAW_TX_RX)
    for (i = 0; i < length; ++i)
    {
        char buf[16];
        sprintf(buf,"T: %#x\r\n", pBuffer[i]);
        putsUART(buf);
    }    
#endif

}
开发者ID:sidwarkd,项目名称:waterworx-device,代码行数:40,代码来源:WFDriverRaw.c


示例6: do_ping_cmd

void do_ping_cmd(void)
{
	int i;

	if(ARGC < 2u)
	{
		putsUART("Please input destination: ping xx.xx.xx.xx count\r\n");
		return;
	}
	for(i=0;i<strlen((const char*)ARGV[1]);i++) PING_Console_Host[i] = ARGV[1][i];
	if(ARGC == 3u)
	{
#if defined (STACK_USE_CERTIFICATE_DEBUG)
		if( strcmppgm2ram((char*)ARGV[2], "forever") == 0)
		{
			b_PingFroever = TRUE;
		}
		else
#endif
			sscanf((const char*)ARGV[2],"%d",(int*)&Count_PingConsole);
	}
	else 
		Count_PingConsole = 4;

}
开发者ID:Athuli7,项目名称:Microchip,代码行数:25,代码来源:WFConsoleMsgHandler.c


示例7: RawGetByte

/*****************************************************************************
 * FUNCTION: RawGetByte
 *
 * RETURNS: error code
 *
 * PARAMS:
 *      rawId   - RAW ID
 *      pBuffer - Buffer to read bytes into
 *      length  - number of bytes to read
 *
 *  NOTES: Reads bytes from the RAW engine
 *****************************************************************************/
void RawGetByte(UINT16 rawId, UINT8 *pBuffer, UINT16 length)
{
    UINT8 regId;
#if defined(OUTPUT_RAW_TX_RX)
	char buf[8];
#endif

    /* if reading a data message do following check */
    if (!g_WaitingForMgmtResponse)
    {
        // if RAW index previously set out of range and caller is trying to do illegal read
        if ((rawId == RAW_RX_ID)		&&
			g_rxIndexSetBeyondBuffer	&& 
			(GetRawWindowState(RAW_RX_ID) == WF_RAW_DATA_MOUNTED))
        {
            WF_ASSERT(FALSE);  /* attempting to read past end of RAW buffer */
        }
    }

    regId = (rawId == RAW_ID_0) ? RAW_0_DATA_REG : RAW_1_DATA_REG;
    ReadWFArray(regId, pBuffer, length);

#if defined(OUTPUT_RAW_TX_RX)
	putrsUART("R:");
    while (length-- != 0)
    {
        sprintf(buf," %02X", *pBuffer++);
        putsUART(buf);
    }
	putrsUART("\r\n");
#endif

}
开发者ID:guillaume9433,项目名称:Microchip,代码行数:45,代码来源:WFDriverRaw.c


示例8: RawSetByte

/*****************************************************************************
 * FUNCTION: RawSetByte
 *
 * RETURNS: None
 *
 * PARAMS:
 *      rawId   - RAW ID
 *      pBuffer - Buffer containing bytes to write
 *      length  - number of bytes to read
 *
 *  NOTES: Writes bytes to RAW window
 *****************************************************************************/
void RawSetByte(UINT16 rawId, UINT8 *pBuffer, UINT16 length)
{
    UINT8 regId;
#if defined(OUTPUT_RAW_TX_RX)
	char buf [8];
#endif    


    /* if previously set index past legal range and now trying to write to RAW engine */
    if ( (rawId == 0) && g_rxIndexSetBeyondBuffer && (GetRawWindowState(RAW_TX_ID) == WF_RAW_DATA_MOUNTED) )
    {
//        WF_ASSERT(FALSE);  /* attempting to write past end of RAW window */
    }

    /* write RAW data to chip */
    regId = (rawId == RAW_ID_0) ? RAW_0_DATA_REG : RAW_1_DATA_REG;
    WriteWFArray(regId, pBuffer, length);

#if defined(OUTPUT_RAW_TX_RX)
	putrsUART("T:");
    while (length-- != 0)
    {
        sprintf(buf," %02X", *pBuffer++);
        putsUART(buf);
    }
	putrsUART("\r\n");
#endif

}
开发者ID:guillaume9433,项目名称:Microchip,代码行数:41,代码来源:WFDriverRaw.c


示例9: RawGetByte

/*****************************************************************************
 * FUNCTION: RawGetByte
 *
 * RETURNS: error code
 *
 * PARAMS:
 *      rawId   - RAW ID
 *      pBuffer - Buffer to read bytes into
 *      length  - number of bytes to read
 *
 *  NOTES: Reads bytes from the RAW engine
 *****************************************************************************/
void RawGetByte(uint16_t rawId, uint8_t *pBuffer, uint16_t length)
{
    uint8_t regId;
#if defined(OUTPUT_RAW_TX_RX)
    uint16_t i;
#endif

    /* if reading a data message do following check */
    if (!g_WaitingForMgmtResponse)
    {
        // if RAW index previously set out of range and caller is trying to do illegal read
        if ( (rawId==RAW_RX_ID)        &&
             g_rxIndexSetBeyondBuffer  &&
             (GetRawWindowState(RAW_RX_ID) == WF_RAW_DATA_MOUNTED) )
        {
            WF_ASSERT(false);  /* attempting to read past end of RAW buffer */
        }
    }

    regId = (rawId==RAW_ID_0) ? RAW_0_DATA_REG:RAW_1_DATA_REG;
    ReadWFArray(regId, pBuffer, length);

#if defined(OUTPUT_RAW_TX_RX)
    for (i = 0; i < length; ++i)
    {
        char buf[16];
        sprintf(buf,"R: %#x\r\n", pBuffer[i]);
        putsUART(buf);
    }
#endif
}
开发者ID:243-510-MA,项目名称:243-510-A15,代码行数:43,代码来源:drv_wifi_raw.c


示例10: WFDisplayScanMgr

extern void
WFDisplayScanMgr()
{
    tWFScanResult   bssDesc;
    char ssid[32];
	char rssiChan[48];

    if (SCANCXT.numScanResults == 0)
       return;
    if (!IS_SCAN_STATE_DISPLAY(SCANCXT.scanState))
       return;

    if (IS_SCAN_IN_PROGRESS(SCANCXT.scanState))
       return;

    if (!IS_SCAN_STATE_VALID(SCANCXT.scanState))
       return;

    WFRetrieveScanResult(SCANCXT.displayIdx, &bssDesc);

    /* Display SSID */
    sprintf(ssid, "%s\r\n", bssDesc.ssid);
    putsUART(ssid);

	/* Display SSID  & Channel */
    /* RSSI_MAX : 200, RSSI_MIN : 106 */
    sprintf(rssiChan, "  => RSSI: %u, Channel: %u\r\n", bssDesc.rssi, bssDesc.channel);
    putsUART(rssiChan);

    if (++SCANCXT.displayIdx == SCANCXT.numScanResults)  {
        SCAN_CLEAR_DISPLAY(SCANCXT.scanState);
        SCANCXT.displayIdx = 0;
#if defined(WF_CONSOLE)
        WFConsoleReleaseConsoleMsg();
#endif
    }

    return;
}
开发者ID:AleSuky,项目名称:SkP32v1.1,代码行数:39,代码来源:WFEasyConfig.c


示例11: slow_event_handler

/*******************************************************
* "Soft" real-time event handler for slow rate
********************************************************/
void slow_event_handler(void)
{
    if(slow_event_count > slow_ticks_limit)
    {
        slow_event_count = 0;
        
        if(control_flags.first_scan)
        {
            putsUART((unsigned char *)WelcomeMsg,&UART1);
            //putsUART((unsigned char *)WelcomeMsg,&UART2);
            
            control_flags.first_scan = 0;
        }

        // (RAM) Parameters update management
        if(control_flags.PAR_update_req)
        {
            update_params();
            control_flags.PAR_update_req = 0;
        }
        
        if(direction_flags.word != direction_flags_prev)
        {
            // RESET COUNTS
            QEI1_Init();
            QEI2_Init();
            Timer1_Init();
            Timer4_Init();
            direction_flags_prev = direction_flags.word;
        }

        // EEPROM update management
        if(control_flags.EE_update_req)
        {
			control_flags.EE_update_req = 0;
        }

        update_delta_joints();
		update_delta_EE();//aggiornamento delle strutture dati
        status_flags.homing_done = home_f.done;

        // SACT protocol timeout manager (see SACT_protocol.c)
        SACT_timeout();
		SACT_SendSDP();
		SACT_SendSSP();

        // CONTROL MODE STATE MANAGER
        control_mode_manager();

    } // END IF slow_event_count..
}// END slow_event_handler
开发者ID:Roberto5,项目名称:rawbot,代码行数:54,代码来源:main.c


示例12: OutputMacAddress

static void OutputMacAddress(void)
{
    UINT8 mac[6];
    int i;
    char buf[4];

    WF_GetMacAddress(mac);
    for (i = 0; i < 6; ++i)
    {
        sprintf(buf, "%02X ", mac[i]);
        putsUART(buf);
    }
    putrsUART("\r\n");
}
开发者ID:cnkker,项目名称:Microchip,代码行数:14,代码来源:WFConsoleIwconfig.c


示例13: DisplayIPValue

// Writes an IP address to the LCD display and the UART as available
void DisplayIPValue(IP_ADDR IPVal)
{
//	printf("%u.%u.%u.%u", IPVal.v[0], IPVal.v[1], IPVal.v[2], IPVal.v[3]);
#if defined (__dsPIC33E__) || defined (__PIC24E__)
	static BYTE IPDigit[4];    					/* Needs to be declared as static to avoid the array getting optimized by C30 v3.30 compiler for dsPIC33E/PIC24E. 
												   Otherwise the LCD displays corrupted IP address on Explorer 16. To be fixed in the future compiler release*/
#else
    BYTE IPDigit[4];
#endif
	BYTE i;
#ifdef USE_LCD
	BYTE j;
	BYTE LCDPos=16;
#endif

	for(i = 0; i < sizeof(IP_ADDR); i++)
	{
	    uitoa((WORD)IPVal.v[i], IPDigit);

		#if defined(STACK_USE_UART)
			putsUART((char *) IPDigit);
		#endif

		#ifdef USE_LCD
			for(j = 0; j < strlen((char*)IPDigit); j++)
			{
				LCDText[LCDPos++] = IPDigit[j];
			}
			if(i == sizeof(IP_ADDR)-1)
				break;
			LCDText[LCDPos++] = '.';
		#else
			if(i == sizeof(IP_ADDR)-1)
				break;
		#endif

		#if defined(STACK_USE_UART)
			while(BusyUART());
			WriteUART('.');
		#endif
	}

	#ifdef USE_LCD
		if(LCDPos < 32u)
			LCDText[LCDPos] = 0;
		LCDUpdate();
	#endif
}
开发者ID:davidbroin,项目名称:controlIOPIC18Eth,代码行数:49,代码来源:MainDemo.c


示例14: SetMode_idle

static UINT8 SetMode_idle(void)
{
    UINT8 networkType;

    WF_CPGetNetworkType(iwconfigCb.cpId, &networkType);

    if (FALSE == iwconfigCb.isIdle )
    {
        if (WF_CMDisconnect() != WF_SUCCESS)
        {
            putsUART("Disconnect failed. Disconnect is allowed only when module is in connected state\r\n");
        }
        WF_PsPollDisable();
#ifdef STACK_USE_CERTIFICATE_DEBUG
        DelayMs(100);
#endif
    }
    return networkType;
}
开发者ID:cnkker,项目名称:Microchip,代码行数:19,代码来源:WFConsoleIwconfig.c


示例15: DisplayIPValue

// Writes an IP address to the LCD display and the UART as available
void DisplayIPValue(IP_ADDR IPVal)
{
//	printf("%u.%u.%u.%u", IPVal.v[0], IPVal.v[1], IPVal.v[2], IPVal.v[3]);
    BYTE IPDigit[4];
	BYTE i;
#ifdef USE_LCD
	BYTE j;
	BYTE LCDPos=16;
#endif

	for(i = 0; i < sizeof(IP_ADDR); i++)
	{
	    uitoa((WORD)IPVal.v[i], IPDigit);

		#if defined(STACK_USE_UART)
			putsUART((char *) IPDigit);
		#endif

		#ifdef USE_LCD
			for(j = 0; j < strlen((char*)IPDigit); j++)
			{
				LCDText[LCDPos++] = IPDigit[j];
			}
			if(i == sizeof(IP_ADDR)-1)
				break;
			LCDText[LCDPos++] = '.';
		#else
			if(i == sizeof(IP_ADDR)-1)
				break;
		#endif

		#if defined(STACK_USE_UART)
			while(BusyUART());
			WriteUART('.');
		#endif
	}

	#ifdef USE_LCD
		if(LCDPos < 32u)
			LCDText[LCDPos] = 0;
		LCDUpdate();
	#endif
}
开发者ID:OptecInc,项目名称:FocusLynx_FW,代码行数:44,代码来源:MainDemo.c


示例16: WFConsolePrintHex

void WFConsolePrintHex(UINT32 val, UINT8 width)
{
    switch (width)
    {
    case 2:
        sprintf( (char *) g_ConsoleContext.txBuf, "%02x", (unsigned int)val);
        break;
    case 4:
        sprintf( (char *) g_ConsoleContext.txBuf, "%04x", (unsigned int)val);
        break;
    case 8:
        sprintf( (char *) g_ConsoleContext.txBuf, "%08lx", (unsigned long)val);
        break;
    default:
        sprintf( (char *) g_ConsoleContext.txBuf, "%x", (unsigned int)val);
    }

    putsUART( (char*) g_ConsoleContext.txBuf);
}
开发者ID:Bobeye,项目名称:cta2045-wifi-modules,代码行数:19,代码来源:WFConsole.c


示例17: reset

    void reset()
    {
    int i = 0, count = 0;
    unsigned char buff;
    /*SOFTWARE RESET COMMAND*/
    do{
    dummy_clocks(8);    
    Command(0X40, 0X00000000, 0X95);    //CMD0
    proceed();
    do{   
        buff = response();
        count++;
      }while((buff!=0X01) && (count<10) );
      count = 0;
    }while(buff!=0X01);
    /*SOFTWARE RESET RESPONSE BIT OBTAINED (0X01)*/
      putsUART("\n\rSD Card Inserted\n\r");
      Delay_s(2);
    return; //CHECK FOR A STA_NODISK return
}
开发者ID:etiq,项目名称:OpenLab-SD-Example,代码行数:20,代码来源:diskio.c


示例18: WFConsolePrintInteger

void WFConsolePrintInteger(UINT32 val, char mode)
{
    switch (mode)
    {
    case 'c':
        sprintf( (char *) g_ConsoleContext.txBuf, "%c", (int)val);
        break;
    case 'x':
        sprintf( (char *) g_ConsoleContext.txBuf, "%x", (unsigned int)val);
        break;
    case 'u':
        sprintf( (char *) g_ConsoleContext.txBuf, "%u", (unsigned int)val);
        break;
    case 'd':
    default:
        sprintf( (char *) g_ConsoleContext.txBuf, "%d", (int)val);
    }

    putsUART( (char*) g_ConsoleContext.txBuf);
}
开发者ID:Bobeye,项目名称:cta2045-wifi-modules,代码行数:20,代码来源:WFConsole.c


示例19: interpreteData

void interpreteData(char rcv)
{
    float param;

    if(indexCommande >= 100)
    {
        indexCommande = 0;
        
        puts("\n\nBuffer Overflow!\n\n");
    }

    if(rcv != '\n')
        commande[indexCommande++] = rcv;
    else
    {
        commande[indexCommande] = '\0';

        putsUART(&(commande[1]));
        param = atof(&(commande[1]));
        interpreteCommande(commande[0], param);
        indexCommande = 0;
    }
}
开发者ID:FlyingYeti,项目名称:ASumoSERV,代码行数:23,代码来源:Interpreter.c


示例20: Backspace

/*= Backspace ================================================================
Purpose: Performs a backspace operation on the command line

Inputs:  none

Returns: none
============================================================================*/
static void Backspace(void)
{
   UINT8 num_chars;
   UINT8 orig_index = GET_CURSOR();

   /* if cursor is not at the left-most position */
   if (GET_CURSOR() != gCmdLinePromptLength)
   {
      /* Null out tmp cmd line */
      memset(gTmpCmdLine, 0x00, sizeof(gTmpCmdLine));

      /* get characters before the backspace */
      num_chars = GET_CURSOR() - gCmdLinePromptLength - 1;
      strncpy( (char *) gTmpCmdLine, (const char *) g_ConsoleContext.rxBuf, num_chars);

      /* append characters after the deleted char (if there are any) */
      if ( (GET_LEN_RX_CMD_STRING() - 1) > 0u)
      {
         strcpy( (char *) &gTmpCmdLine[num_chars], (const char *) &g_ConsoleContext.rxBuf[num_chars + 1]);
      }

      EraseEntireLine();  /* leaves g_ConsoleContext.cursorIndex at 0 */

      strcpy( (char *) g_ConsoleContext.rxBuf, (const char *) gTmpCmdLine);

      putrsUART( (ROM FAR char *) gCmdLinePrompt);
      putsUART( (char *) g_ConsoleContext.rxBuf);
      SET_CURSOR(gCmdLinePromptLength + GET_LEN_RX_CMD_STRING());

      CursorHome(); /* to first character after prompt */


      /* move cursor to point of backspace */
      CursorRight_N(orig_index - 1 - gCmdLinePromptLength);
   }
}
开发者ID:Bobeye,项目名称:cta2045-wifi-modules,代码行数:43,代码来源:WFConsole.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ putstr函数代码示例发布时间:2022-05-30
下一篇:
C++ puts函数代码示例发布时间: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