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

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

?? lpc21isp.c

?? LPC2000系列化的ISP下載源程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
/***************************** DebugPrintf ******************************//**  Prints a debug string depending the current debug level. The higherthe debug level the more detail that will be printed.  Each printhas an associated level, the higher the level the more detailed thedebugging information being sent.\param [in] level the debug level of the print statement, if the level is less than or equal to the current debug level it will be printed.\param [in] fmt a standard printf style format string.\param [in] ... the usual printf parameters.*/static void DebugPrintf( int level, const char *fmt, ...){    va_list ap;    if( level <= debug_level)    {        va_start( ap, fmt);        vprintf( fmt, ap);        va_end( ap);        fflush( stdout);    }}/***************************** ReceiveComPort ***************************//**  Receives a buffer from the open com port. Returns when the buffer isfilled, the numer of requested linefeeds has been received or the timeoutperiod has passed\param [in] ISPEnvironment.\param [out] Answer buffer to hold the bytes read from the serial port.\param [in] MaxSize the size of buffer pointed to by Answer.\param [out] RealSize pointer to a long that returns the amout of thebuffer that is actually used.\param [in] WantedNr0x0A the maximum number of linefeeds to accept beforereturning.\param [in] timeOutMilliseconds the maximum amount of time to wait beforereading with an incomplete buffer.*/static void ReceiveComPort( ISP_ENVIRONMENT *IspEnvironment,                            void *Ans, unsigned long MaxSize,                            unsigned long *RealSize, unsigned long WantedNr0x0A,                            unsigned timeOutMilliseconds){    unsigned long tmp_realsize;    unsigned long nr_of_0x0A = 0;    int eof = 0;    unsigned long p;    char *Answer;    Answer = Ans;    SerialTimeoutSet( IspEnvironment, timeOutMilliseconds);    (*RealSize) = 0;    do    {        ReceiveComPortBlock( IspEnvironment, Answer + (*RealSize), MaxSize - 1 - (*RealSize), &tmp_realsize);        if(tmp_realsize != 0)        {            for(p = (*RealSize); p < (*RealSize) + tmp_realsize; p++)            {                if(Answer[p] == 0x0a)                {                    nr_of_0x0A++;                }                else if(Answer[p] < 0)                {                    eof = 1;                }            }        }        (*RealSize) += tmp_realsize;    } while(((*RealSize) < MaxSize) && (SerialTimeoutCheck(IspEnvironment) == 0) && (nr_of_0x0A < WantedNr0x0A) && !eof);    Answer[(*RealSize)] = 0;    DumpString( 3, Answer, (*RealSize), "Answer(Length=%ld): ", (*RealSize));}#if !defined COMPILE_FOR_LPC21/***************************** ReceiveComPortBlockComplete **************//**  Receives a fixed block from the open com port. Returns when theblock is completely filled or the timeout period has passed\param [out] block buffer to hold the bytes read from the serial port.\param [in] size the size of the buffer pointed to by block.\param [in] timeOut the maximum amount of time to wait before guvung up oncompleting the read.\return 0 if successful, non-zero otherwise.*/static int ReceiveComPortBlockComplete( ISP_ENVIRONMENT *IspEnvironment,                                        void *block, size_t size, unsigned timeout){    unsigned long realsize = 0, read;    char *result;    result = block;    SerialTimeoutSet( IspEnvironment, timeout);    do    {        ReceiveComPortBlock( IspEnvironment, result + realsize, size - realsize, &read);        realsize += read;    } while((realsize < size) && (SerialTimeoutCheck(IspEnvironment) == 0));    DumpString( 3, result, realsize, "Answer(Length=%ld): ", realsize);    if( realsize != size)    {        return 1;    }    return 0;}/***************************** ReadArguments ****************************//**  Reads the command line arguments and parses it for the variousoptions. Uses the same arguments as main.  Used to separate the commandline parsing from main and improve its readability.  This should also makeit easier to modify the command line parsing in the future.\param [in] argc the number of arguments.\param [in] argv an array of pointers to the arguments.*/static void ReadArguments(ISP_ENVIRONMENT *IspEnvironment, int argc, char *argv[]){    int i;    if(argc >= 5)    {        for(i = 1; i < argc - 4; i++)        {            if(stricmp(argv[i], "-bin") == 0)            {                 IspEnvironment->FormatHex = 0;                 DebugPrintf( 3, "Binary format file input.\n");            }            else if(stricmp(argv[i], "-hex") == 0)            {                 IspEnvironment->FormatHex = 1;                 DebugPrintf( 3, "Hex format file input.\n");            }            else if(stricmp(argv[i], "-term") == 0)            {                 IspEnvironment->TerminalAfterUpload = 1;                 DebugPrintf( 3, "Invoke terminal after upload.\n");            }            else if(stricmp(argv[i], "-termonly") == 0)            {                 IspEnvironment->TerminalOnly = 1;                 DebugPrintf( 3, "Only provide terminal.\n");            }            else if(stricmp(argv[i], "-detectonly") == 0)            {                 IspEnvironment->DetectOnly = 1;                 DebugPrintf( 3, "Only detect LPC chip part id.\n");            }            else if(stricmp(argv[i], "-debug") == 0)            {                 debug_level = 4;                 DebugPrintf( 3, "Turn on debug.\n");            }            else if(stricmp(argv[i], "-control") == 0)            {                 IspEnvironment->ControlLines = 1;                 DebugPrintf( 3, "Use RTS/DTS to control target state.\n");            }            else if(stricmp(argv[i], "-logfile") == 0)            {                 IspEnvironment->LogFile = 1;                 DebugPrintf( 3, "Log terminal output.\n");            }            else if( stricmp( argv[i], "-ADARM") == 0)            {                IspEnvironment->micro = ANALOG_DEVICES_ARM;                DebugPrintf( 2, "Target: Analog Devices.\n");            }            else if( stricmp( argv[i], "-PHILIPSARM") == 0)            {                IspEnvironment->micro = PHILIPS_ARM;                DebugPrintf( 2, "Target: Philips.\n");            }            else            {                DebugPrintf( 2, "Unknown command line option: \"%s\"\n", argv[i]);            }        }        IspEnvironment->input_file = argv[argc - 4];        IspEnvironment->StringOscillator = argv[argc - 1];        IspEnvironment->serial_port = argv[argc - 3];        IspEnvironment->baud_rate = argv[argc - 2];    }    if(argc < 5)    {        debug_level = (debug_level < 2) ? 2 : debug_level;    }    if(argc < 5)    {        DebugPrintf( 2, "\n");        DebugPrintf( 2, "Portable command line ISP for Philips LPC2000 family and \n");        DebugPrintf( 2, "Version 1.23                  Analog Devices ADUC 70xx\n");        DebugPrintf( 2, "Compiled for %s: %s %s\n", COMPILED_FOR, __DATE__, __TIME__);        DebugPrintf( 2, "Copyright (c) by Martin Maurer, 2003, 2004  Email: Martin.Maurer@clibb.de\n");        DebugPrintf( 2, "Portions Copyright (c) by Aeolus Development 2004\n");        DebugPrintf( 2, "                 http://www.aeolusdevelopment.com\n");        DebugPrintf( 2, "\n");        DebugPrintf( 1, "Syntax:  lpc21isp [Options] file comport baudrate Oscillator_in_kHz\n\n");        DebugPrintf( 1, "Example: lpc21isp test.hex com1 115200 14746\n\n");        DebugPrintf( 1, "Options: -bin           for uploading binary file\n");        DebugPrintf( 1, "         -hex           for uploading file in intel hex format (default)\n");        DebugPrintf( 1, "         -term          for starting terminal after upload\n");        DebugPrintf( 1, "         -termonly      for starting terminal without an upload\n");        DebugPrintf( 1, "         -detectonly    detect only used LPC chiptype (PHILIPSARM only)\n");        DebugPrintf( 1, "         -debug         for creating a lot of debug infos\n");        DebugPrintf( 1, "         -control       for controlling RS232 lines for easier booting\n");        DebugPrintf( 1, "                        (Reset = DTR, EnableBootLoader = RTS)\n");        DebugPrintf( 1, "         -logfile       for enabling logging of terminal output to lpc21isp.log\n");        DebugPrintf( 1, "         -ADARM         for downloading to an Analog Devices\n");        DebugPrintf( 1, "                        ARM microcontroller ADUC70xx\n");        DebugPrintf( 1, "         -PHILIPSARM    for downloading to a microcontroller from\n");        DebugPrintf( 1, "                        Philips LPC2000 family (default)\n");        exit(1);    }    if(IspEnvironment->micro == PHILIPS_ARM)    {        if (strlen(IspEnvironment->StringOscillator) > 5)        {            printf("Invalid crystal frequency %s",argv[argc - 1]);            exit(1);        }    }}typedef enum{    PROGRAM_MODE,    RUN_MODE} TARGET_MODE;/***************************** ResetTarget ******************************//**  Resets the target leaving it in either download (program) mode orrun mode.\param [in] mode the mode to leave the target in.*/static void ResetTarget( ISP_ENVIRONMENT *IspEnvironment, TARGET_MODE mode){    if(IspEnvironment->ControlLines)    {        switch( mode)        {                /* Reset and jump to boot loader.                       */            case PROGRAM_MODE:                ControlModemLines(IspEnvironment, 1, 1);                Sleep(100);                ClearSerialPortBuffers(IspEnvironment);                Sleep(100);                ControlModemLines(IspEnvironment, 0, 1);                Sleep(100);                // Clear the RTS line after having reset the micro                // Needed for the "GO <Address> <Mode>" ISP command to work */                ControlModemLines(IspEnvironment, 0, 0);                break;                /* Reset and start uploaded program                     */            case RUN_MODE:                ControlModemLines(IspEnvironment, 1, 0);                Sleep(100);                ClearSerialPortBuffers(IspEnvironment);                Sleep(100);                ControlModemLines(IspEnvironment, 0, 0);                Sleep(100);                break;        }    }}/***************************** LoadFile *********************************//**  Loads the requested file to download into memory.\param [in] IspEnvironment  structure containing input filename*/static void LoadFile(ISP_ENVIRONMENT *IspEnvironment){    int fd;    int i;    unsigned long  Pos;    unsigned long  FileLength;    BINARY        *FileContent;              /**< Used to store the content of a hex */                                             /* file before converting to binary.    */    unsigned long BinaryMemSize;    fd = open(IspEnvironment->input_file, O_RDONLY | O_BINARY);    if(fd == -1)    {        DebugPrintf( 1, "Can't open file %s\n", IspEnvironment->input_file);        exit(1);    }    FileLength = lseek(fd, 0L, 2);      // Get file size    if(FileLength == (size_t)-1)    {        DebugPrintf( 1, "\nFileLength = -1 !?!\n");        exit(1);    }    lseek(fd, 0L, 0);    FileContent = malloc(FileLength);    BinaryMemSize = FileLength * 2;    IspEnvironment->BinaryLength = 0;	/* Increase length as needed.		*/    IspEnvironment->BinaryContent = malloc(BinaryMemSize);    read(fd, FileContent, FileLength);    close(fd);    DebugPrintf( 2, "File %s loaded...\n", IspEnvironment->input_file);        // Intel-Hex -> Binary Conversion    if(IspEnvironment->FormatHex != 0)    {        unsigned char  RecordLength;        unsigned short RecordAddress;        unsigned long  RealAddress = 0;        unsigned char  RecordType;        unsigned char  Hexvalue;        DebugPrintf( 2, "Converting file %s to binary format...\n", IspEnvironment->input_file);        Pos = 0;        while(Pos < FileLength)        {            if(FileContent[Pos] == '\r')            {                Pos++;                continue;            }            if(FileContent[Pos] == '\n')            {                Pos++;                continue;            }            if(FileContent[Pos] != ':')            {                DebugPrintf( 1, "Missing start of record (':') wrong byte %c / %02X\n", FileContent[Pos], FileContent[Pos]);                exit(1);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频1区2区| 在线观看欧美黄色| 日韩**一区毛片| 亚洲色图在线视频| 国产精品久久久久久久久久久免费看 | 99久久精品国产观看| 久久超碰97人人做人人爱| 秋霞午夜鲁丝一区二区老狼| 老司机免费视频一区二区三区| 日韩电影网1区2区| 精品亚洲成av人在线观看| 国产一区二区不卡在线| 成人国产精品免费网站| av高清久久久| 日本乱人伦一区| 欧美日韩午夜影院| 日韩一级免费观看| 久久久亚洲午夜电影| 中文字幕成人av| 国产精品伦理在线| 亚洲一级片在线观看| 亚洲一线二线三线视频| 老司机免费视频一区二区三区| 国产精品一品视频| 色婷婷狠狠综合| 日韩区在线观看| 中文字幕一区三区| 日韩国产精品久久久| 麻豆成人在线观看| 国产**成人网毛片九色| 成人av电影免费在线播放| 欧美日韩另类一区| 久久久久久久电影| 亚洲国产aⅴ天堂久久| 国产精品77777| 欧美色窝79yyyycom| 国产亚洲精品免费| 五月天欧美精品| av动漫一区二区| 精品久久人人做人人爽| 一区二区激情视频| 国内精品久久久久影院薰衣草| 91尤物视频在线观看| 日韩精品专区在线影院重磅| 亚洲欧美电影一区二区| 精品在线一区二区| 欧美日韩免费观看一区二区三区| 欧美激情自拍偷拍| 久久成人免费网| 欧美丝袜丝交足nylons图片| 中文字幕国产精品一区二区| 久久精品国产99国产精品| 欧美在线影院一区二区| 国产精品美日韩| 国产一区日韩二区欧美三区| 欧美精品久久99久久在免费线| 亚洲天堂网中文字| 粉嫩嫩av羞羞动漫久久久| 日韩亚洲欧美一区| 午夜在线成人av| 91麻豆精品国产91久久久更新时间| 国产蜜臀97一区二区三区| 久99久精品视频免费观看| 欧美日韩高清一区二区三区| 亚洲综合免费观看高清完整版在线| 国产成人一区二区精品非洲| 欧美日韩精品欧美日韩精品| 夜夜揉揉日日人人青青一国产精品| 99久久婷婷国产综合精品 | 99久久国产综合精品色伊| 久久综合九色综合欧美就去吻| 亚洲综合激情另类小说区| 91蜜桃传媒精品久久久一区二区| 欧美国产视频在线| 99久久免费国产| 亚洲青青青在线视频| 一本到不卡精品视频在线观看| 一区免费观看视频| a级高清视频欧美日韩| 国产精品无人区| 99re热视频这里只精品| 亚洲精品视频在线观看免费| 91极品美女在线| 亚洲444eee在线观看| 91精品国产综合久久福利| 日av在线不卡| 久久久噜噜噜久噜久久综合| 国产不卡免费视频| 亚洲私人黄色宅男| 欧美三区免费完整视频在线观看| 午夜影院久久久| 精品国产污网站| 91在线精品一区二区| 亚洲人妖av一区二区| 欧美日韩日日骚| 激情另类小说区图片区视频区| 久久精品这里都是精品| 91视视频在线直接观看在线看网页在线看| 中文字幕色av一区二区三区| 欧美天堂一区二区三区| 日本va欧美va精品发布| 久久一区二区三区四区| 一本高清dvd不卡在线观看| 亚洲h在线观看| 国产欧美日韩麻豆91| 欧美亚男人的天堂| 经典三级一区二区| 亚洲激情六月丁香| 精品国产免费人成电影在线观看四季| 国产精品亚洲第一| 香蕉影视欧美成人| 国产精品婷婷午夜在线观看| 91.com在线观看| proumb性欧美在线观看| 免费不卡在线视频| 亚洲图片另类小说| 久久嫩草精品久久久久| 欧美人动与zoxxxx乱| 春色校园综合激情亚洲| 日韩国产一区二| 亚洲三级视频在线观看| 久久久欧美精品sm网站| 欧美日韩在线播放一区| 不卡的av在线| 国产一区视频在线看| 日韩二区三区在线观看| 亚洲精品欧美激情| 中文字幕精品三区| 26uuu亚洲综合色| 3d成人h动漫网站入口| 欧美自拍丝袜亚洲| 97精品国产露脸对白| 91视频www| 懂色一区二区三区免费观看 | 精品国产髙清在线看国产毛片| 91黄色在线观看| 97国产精品videossex| 国产精品77777| 国产美女视频91| 久久精品国产精品亚洲精品| 亚洲电影第三页| 亚洲图片自拍偷拍| 亚洲精品国产无套在线观| 国产精品情趣视频| 日本一区二区三区国色天香 | 欧美日韩国产另类不卡| 色综合网站在线| 成人av影视在线观看| 成人小视频在线观看| 成人激情免费网站| 99久久久久免费精品国产 | 亚洲最快最全在线视频| 亚洲人xxxx| 亚洲自拍另类综合| 一区二区三区欧美日韩| 伊人色综合久久天天人手人婷| 亚洲女厕所小便bbb| 亚洲欧美成aⅴ人在线观看 | 三级一区在线视频先锋| 丝袜美腿亚洲色图| 美腿丝袜一区二区三区| 狠狠网亚洲精品| 国产黄色91视频| 91麻豆免费看片| 欧美网站大全在线观看| 91精品国产综合久久精品图片| 日韩三级av在线播放| 一区二区三区加勒比av| 亚洲一区二区综合| 美女任你摸久久| 极品少妇xxxx精品少妇偷拍 | 亚洲尤物在线视频观看| 天天影视网天天综合色在线播放| 麻豆精品视频在线| 国产精品中文字幕一区二区三区| av电影在线观看一区| 欧美影院精品一区| 精品国产免费一区二区三区四区 | 男女视频一区二区| 国产一区二区91| 欧洲精品一区二区| 欧美不卡激情三级在线观看| 国产精品欧美一区二区三区| 亚洲一区中文在线| 国产精品77777竹菊影视小说| 色偷偷一区二区三区| 日韩精品一区二区三区蜜臀| 中文天堂在线一区| 日本aⅴ精品一区二区三区 | 欧美精品v国产精品v日韩精品| 精品福利在线导航| 洋洋成人永久网站入口| 精品一区二区三区视频| 欧美在线一二三| 国产丝袜美腿一区二区三区| 天天射综合影视| 91蝌蚪国产九色| 久久夜色精品一区| 奇米亚洲午夜久久精品| 色999日韩国产欧美一区二区|