亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ustdlib.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
字號:
//*****************************************************************************
//
// ustdlib.c - Simple standard library functions.
//
// Copyright (c) 2007 Luminary Micro, Inc.  All rights reserved.
// 
// Software License Agreement
// 
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's microcontroller products.
// 
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  Any use in violation
// of the foregoing restrictions may subject the user to criminal sanctions
// under applicable laws, as well as to civil liability for the breach of the
// terms and conditions of this license.
// 
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
// 
//*****************************************************************************

#include <stdarg.h>
#include <string.h>
#include "debug.h"

//*****************************************************************************
//
//! \addtogroup utilities_api
//! @{
//
//*****************************************************************************

//*****************************************************************************
//
// A mapping from an integer between 0 and 15 to its ASCII character
// equivalent.
//
//*****************************************************************************
static const char * const g_pcHex = "0123456789abcdef";

//*****************************************************************************
//
//! A simple sprintf function supporting \%c, \%d, \%s, \%u, \%x, and \%X.
//!
//! \param pcBuf is the buffer where the converted string is stored.
//! \param pcString is the format string.
//! \param ... are the optional arguments, which depend on the contents of the
//! format string.
//!
//! This function is very similar to the C library <tt>sprintf()</tt> function.
//! Only the following formatting characters are supported:
//!
//! - \%c to print a character
//! - \%d to print a decimal value
//! - \%s to print a string
//! - \%u to print an unsigned decimal value
//! - \%x to print a hexadecimal value using lower case letters
//! - \%X to print a hexadecimal value using lower case letters (not upper case
//! letters as would typically be used)
//! - \%\% to print out a \% character
//!
//! For \%d, \%u, \%x, and \%X, an optional number may reside between the \%
//! and the format character, which specifies the minimum number of characters
//! to use for that value; if preceeded by a 0 then the extra characters will
//! be filled with zeros instead of spaces.  For example, ``\%8d'' will use
//! eight characters to print the decimal value with spaces added to reach
//! eight; ``\%08d'' will use eight characters as well but will add zeros
//! instead of spaces.
//!
//! The type of the arguments after \b pcString must match the requirements of
//! the format string.  For example, if an integer was passed where a string
//! was expected, an error of some kind will most likely occur.
//!
//! The caller must ensure that the buffer pcBuf is large enough to hold the
//! entire converted string, including the null termination character.
//!
//! \return None.
//
//*****************************************************************************
void
usprintf(char *pcBuf, const char *pcString, ...)
{
    unsigned long ulIdx, ulValue, ulPos, ulCount, ulBase;
    char *pcStr, cFill;
    va_list vaArgP;

    //
    // Check the arguments.
    //
    ASSERT(pcString != 0);
    ASSERT(pcBuf != 0);

    //
    // Start the varargs processing.
    //
    va_start(vaArgP, pcString);

    //
    // Loop while there are more characters in the string.
    //
    while(*pcString)
    {
        //
        // Find the first non-% character, or the end of the string.
        //
        for(ulIdx = 0; (pcString[ulIdx] != '%') && (pcString[ulIdx] != '\0');
            ulIdx++)
        {
        }

        //
        // Write this portion of the string.
        //
        strncpy(pcBuf, pcString, ulIdx);

        //
        // Skip the portion of the string that was written.
        //
        pcString += ulIdx;
        pcBuf += ulIdx;

        //
        // See if the next character is a %.
        //
        if(*pcString == '%')
        {
            //
            // Skip the %.
            //
            pcString++;

            //
            // Set the digit count to zero, and the fill character to space
            // (i.e. to the defaults).
            //
            ulCount = 0;
            cFill = ' ';

            //
            // It may be necessary to get back here to process more characters.
            // Goto's aren't pretty, but effective.  I feel extremely dirty for
            // using not one but two of the beasts.
            //
again:

            //
            // Determine how to handle the next character.
            //
            switch(*pcString++)
            {
                //
                // Handle the digit characters.
                //
                case '0':
                case '1':
                case '2':
                case '3':
                case '4':
                case '5':
                case '6':
                case '7':
                case '8':
                case '9':
                {
                    //
                    // If this is a zero, and it is the first digit, then the
                    // fill character is a zero instead of a space.
                    //
                    if((pcString[-1] == '0') && (ulCount == 0))
                    {
                        cFill = '0';
                    }

                    //
                    // Update the digit count.
                    //
                    ulCount *= 10;
                    ulCount += pcString[-1] - '0';

                    //
                    // Get the next character.
                    //
                    goto again;
                }

                //
                // Handle the %c command.
                //
                case 'c':
                {
                    //
                    // Get the value from the varargs.
                    //
                    ulValue = va_arg(vaArgP, unsigned long);

                    //
                    // Print out the character.
                    //
                    *pcBuf++ = (char)ulValue;

                    //
                    // This command has been handled.
                    //
                    break;
                }

                //
                // Handle the %d command.
                //
                case 'd':
                {
                    //
                    // Get the value from the varargs.
                    //
                    ulValue = va_arg(vaArgP, unsigned long);

                    //
                    // Reset the buffer position.
                    //
                    ulPos = 0;

                    //
                    // If the value is negative, make it positive and stick a
                    // minus sign in the beginning of the buffer.
                    //
                    if((long)ulValue < 0)
                    {
                        *pcBuf++ = '-';
                        ulPos++;
                        ulValue = -(long)ulValue;
                    }

                    //
                    // Set the base to 10.
                    //
                    ulBase = 10;

                    //
                    // Convert the value to ASCII.
                    //
                    goto convert;
                }

                //
                // Handle the %s command.
                //
                case 's':
                {
                    //
                    // Get the string pointer from the varargs.
                    //
                    pcStr = va_arg(vaArgP, char *);

                    //
                    // Determine the length of the string.
                    //
                    for(ulIdx = 0; pcStr[ulIdx] != '\0'; ulIdx++)
                    {
                    }

                    //
                    // Write the string.
                    //
                    strncpy(pcBuf, pcStr, ulIdx);
                    pcBuf += ulIdx;

                    //
                    // This command has been handled.
                    //
                    break;
                }

                //
                // Handle the %u command.
                //
                case 'u':
                {
                    //
                    // Get the value from the varargs.
                    //
                    ulValue = va_arg(vaArgP, unsigned long);

                    //
                    // Reset the buffer position.
                    //
                    ulPos = 0;

                    //
                    // Set the base to 10.
                    //
                    ulBase = 10;

                    //
                    // Convert the value to ASCII.
                    //
                    goto convert;
                }

                //
                // Handle the %x and %X commands.  Note that they are treated
                // identically; i.e. %X will use lower case letters for a-f
                // instead of the upper case letters is should use.
                //
                case 'x':
                case 'X':
                {
                    //
                    // Get the value from the varargs.
                    //
                    ulValue = va_arg(vaArgP, unsigned long);

                    //
                    // Reset the buffer position.
                    //
                    ulPos = 0;

                    //
                    // Set the base to 16.
                    //
                    ulBase = 16;

                    //
                    // Determine the number of digits in the string version of
                    // the value.
                    //
convert:
                    for(ulIdx = 1;
                        (((ulIdx * ulBase) <= ulValue) &&
                         (((ulIdx * ulBase) / ulBase) == ulIdx));
                        ulIdx *= ulBase, ulCount--)
                    {
                    }

                    //
                    // Provide additional padding at the beginning of the
                    // string conversion if needed.
                    //
                    if((ulCount > 1) && (ulCount < 16))
                    {
                        for(ulCount--; ulCount; ulCount--)
                        {
                            *pcBuf++ = cFill;
                            ulPos++;
                        }
                    }

                    //
                    // Convert the value into a string.
                    //
                    for(; ulIdx; ulIdx /= ulBase)
                    {
                        *pcBuf++ = g_pcHex[(ulValue / ulIdx) % ulBase];
                        ulPos++;
                    }

                    //
                    // This command has been handled.
                    //
                    break;
                }

                //
                // Handle the %% command.
                //
                case '%':
                {
                    //
                    // Simply write a single %.
                    //
                    *pcBuf++ = pcString[-1];

                    //
                    // This command has been handled.
                    //
                    break;
                }

                //
                // Handle all other commands.
                //
                default:
                {
                    //
                    // Indicate an error.
                    //
                    strncpy(pcBuf, "ERROR", 5);
                    pcBuf += 5;

                    //
                    // This command has been handled.
                    //
                    break;
                }
            }
        }
    }

    //
    // End the varargs processing.
    //
    va_end(vaArgP);

    //
    // Null terminate the string in the buffer.
    //
    *pcBuf = 0;
}

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级欧美一级| 水蜜桃久久夜色精品一区的特点| 国产精品久久久久久一区二区三区 | 午夜久久电影网| 舔着乳尖日韩一区| 国产乱码精品一区二区三区忘忧草| 大胆欧美人体老妇| 欧美少妇一区二区| 精品国产成人在线影院| 亚洲视频每日更新| 日日嗨av一区二区三区四区| 国产精品亚洲午夜一区二区三区| 91视视频在线观看入口直接观看www| 精品视频1区2区3区| 精品成人免费观看| 亚洲精品午夜久久久| 激情五月婷婷综合网| 一本色道久久综合亚洲aⅴ蜜桃| 欧美日韩三级在线| 国产精品久久看| 日韩极品在线观看| 91免费观看在线| 精品久久久三级丝袜| 亚洲黄色录像片| 国产精品自在欧美一区| 欧洲视频一区二区| 国产日韩精品视频一区| 亚洲国产精品一区二区久久| 国产精品白丝jk黑袜喷水| 欧美日精品一区视频| 国产精品毛片无遮挡高清| 久久疯狂做爰流白浆xx| 欧美在线视频不卡| 中文av一区二区| 蜜桃在线一区二区三区| 在线免费观看日本一区| 欧美国产综合色视频| 久久精品国产久精国产| 在线观看日韩电影| 国产精品亲子伦对白| 蜜臀久久久99精品久久久久久| 中文字幕五月欧美| 日韩欧美在线影院| 国产精品嫩草影院av蜜臀| 秋霞av亚洲一区二区三| 91精品福利视频| 国产午夜精品久久久久久久| 日韩av电影免费观看高清完整版| 色偷偷成人一区二区三区91| 国产亚洲综合在线| 日本在线不卡视频一二三区| 欧美午夜电影一区| 有码一区二区三区| 国产精品一区二区x88av| 欧美一二区视频| 亚洲123区在线观看| 日本精品视频一区二区| 天天综合天天综合色| 精品国产a毛片| 午夜av区久久| 日本不卡一二三| 91在线一区二区三区| 中文天堂在线一区| 懂色av一区二区三区免费观看 | 亚洲欧洲日韩在线| 国产宾馆实践打屁股91| 亚洲精品中文在线| 1区2区3区国产精品| 福利一区二区在线| 国产亚洲成av人在线观看导航| 精品一二三四在线| 日韩欧美成人一区| 久久精品二区亚洲w码| 欧美一区二区三区免费大片| 日韩在线观看一区二区| 91精品国产一区二区| 免费三级欧美电影| 精品国产一区二区三区忘忧草| 老司机免费视频一区二区三区| 日韩午夜激情av| 狠狠色狠狠色合久久伊人| 欧美成人a视频| 黄色资源网久久资源365| 久久久久国产免费免费| 国产高清不卡二三区| 欧美国产丝袜视频| 91美女片黄在线观看91美女| 亚洲影视资源网| 欧美一区二区视频观看视频| 免费不卡在线观看| 久久免费午夜影院| 99视频在线精品| 一区二区三区日本| 欧美日本乱大交xxxxx| 蜜臀va亚洲va欧美va天堂| 精品国产一区久久| 波多野结衣中文字幕一区二区三区| 视频在线观看91| 一区二区理论电影在线观看| 在线观看视频一区二区欧美日韩| 一区二区三区成人| 欧美一区二区三区公司| 国产一区免费电影| 国产精品久久久久久久久图文区 | 精品美女被调教视频大全网站| 国内精品第一页| 国产精品久久久99| 欧美视频第二页| 国内精品国产成人| 亚洲视频一区二区免费在线观看| 欧美视频在线一区二区三区 | 欧美午夜精品一区二区蜜桃| 日本成人超碰在线观看| 久久久久国产精品人| 色av一区二区| 久久精品国产999大香线蕉| 国产精品久久久久婷婷 | 蜜臀精品久久久久久蜜臀| 亚洲国产精品成人综合| 在线区一区二视频| 欧美麻豆精品久久久久久| 另类中文字幕网| 国产精品久久久久久久第一福利| 欧美日韩免费不卡视频一区二区三区| 久久激情五月激情| 亚洲美女免费在线| 精品欧美一区二区三区精品久久| 成人ar影院免费观看视频| 日韩成人免费看| 亚洲人成人一区二区在线观看| 欧美一区二区私人影院日本| av综合在线播放| 男人的j进女人的j一区| 亚洲视频在线一区观看| 日韩三级高清在线| 一本到高清视频免费精品| 国精产品一区一区三区mba视频 | 欧美在线免费视屏| 国产一区二区免费视频| 亚洲高清三级视频| 亚洲国产经典视频| 91精品综合久久久久久| 97国产一区二区| 国产裸体歌舞团一区二区| 一区二区三区欧美视频| 国产无人区一区二区三区| 制服丝袜av成人在线看| 91麻豆国产香蕉久久精品| 国产精品一区三区| 麻豆精品蜜桃视频网站| 一区二区国产盗摄色噜噜| 中文字幕第一区第二区| 精品国产乱码久久| 欧美一区二区三区不卡| 欧美午夜宅男影院| 99九九99九九九视频精品| 国产成人亚洲综合a∨婷婷图片| 日韩制服丝袜av| 亚洲aⅴ怡春院| 夜色激情一区二区| ●精品国产综合乱码久久久久| 久久免费电影网| 欧美一区二区精美| 欧美三级一区二区| 欧洲av一区二区嗯嗯嗯啊| 99国产欧美另类久久久精品| 国产精品小仙女| 国产麻豆精品一区二区| 久久精品国产成人一区二区三区| 日韩高清不卡一区| 三级一区在线视频先锋| 亚洲高清免费视频| 亚洲成av人影院| 性做久久久久久久久| 亚洲福利一区二区| 亚洲第一综合色| 亚洲va欧美va人人爽午夜| 亚洲亚洲人成综合网络| 一区二区三区欧美亚洲| 亚洲综合网站在线观看| 亚洲国产精品嫩草影院| 亚洲高清免费一级二级三级| 亚洲成人资源在线| 日韩精品三区四区| 丝袜美腿高跟呻吟高潮一区| 日韩中文字幕区一区有砖一区 | 69成人精品免费视频| 欧美日韩国产高清一区二区 | 日本va欧美va精品发布| 天天综合日日夜夜精品| 热久久久久久久| 麻豆成人在线观看| 国模套图日韩精品一区二区| 国产风韵犹存在线视精品| 成人av先锋影音| 99国产精品久| 欧美自拍偷拍一区| 欧美日韩国产首页| 91精品国产欧美一区二区 | 国产一区二区导航在线播放|