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

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

?? dl_edb7xxx.c

?? eCos操作系統源碼
?? C
字號:
//****************************************************************************//// DOWNLOAD.C - Automates the download of code into the flash on the//              Cirrus Logic EDB7XXX boards.//// Copyright (c) 1999 Cirrus Logic, Inc.//// Adapted for Linux by Red Hat, Inc.//   Renamed 'dl_edb7xxx' to indicate support for all Cirrus Logic eval boards.////****************************************************************************#include <stdio.h>#include "bootcode.h"#ifndef _WIN32#define CHAR_READY_IS_RELIABLE#endif#define DEFAULT_PORT "/dev/ttyS0"extern char _ReceiveChar(long);extern void _SendChar(long, char);extern void _SetBaud(long, long);extern int  _CharRead(long port);extern void _WaitForOutputReady(long port);extern long _OpenPort(char *);extern int  _CharReady(long port);#define ReceiveChar _ReceiveChar#define SendChar    _SendChar#define SetBaud     _SetBaud#define CharRead    _CharRead#define WaitForOutputEmpty _WaitForOutputEmpty#define OpenPort    _OpenPort#define CharReady   _CharReady//****************************************************************************//// WaitFor waits until a specific character is read from the comm port.////****************************************************************************voidWaitFor(long lPort, char cWaitChar){    char cChar;    //    // Wait until we read a specific character from the comm port.    //    while(1)    {        //        // Read a character.        //        cChar = ReceiveChar(lPort);        //        // Stop waiting if we received the character.        //        if(cChar == cWaitChar)        {            break;        }    }}//****************************************************************************//// This program waits for the '<' character from the boot ROM, sends the boot// code, waits for the '>' from the boot ROM, waits for the '?' from the boot// code, changes the serial port rate (preferably to 115200), downloads the// user data file, and then prints out progress status as the boot code writes// the user data file to the flash.////****************************************************************************voidmain(int argc, char *argv[]){    long lPort;    long lRate = 38400;    long lFileSize, lIdx;    char cChar, cFirstChar, *pcFile, cRateChar;    FILE *pFile;    //    // Make sure that a filename was specified.    //    if(argc < 2)    {        fprintf(stderr, "Usage: %s <filename> {<baud rate> {<comm port>}}\n", argv[0]);        return;    }    //    // If a baud rate was specified, then read it and make sure it is valid.    //    if(argc > 2)    {        lRate = atoi(argv[2]);        if((lRate != 9600) && (lRate != 19200) && (lRate != 28800) &&           (lRate != 38400) && (lRate != 57600) && (lRate != 115200))        {            fprintf(stderr, "Invalid baud rate: %d(%s).\n", lRate, argv[2]);            return;        }    }    //    // If a comm port was specified, then read it and make sure it is valid.    //    if(argc > 3)    {        lPort = OpenPort(argv[3]);        if (lPort < 0)        {            fprintf(stderr, "Can't open port: %s\n", argv[3]);            return;        }    } else     {        lPort = OpenPort(DEFAULT_PORT);        if (lPort < 0)        {            fprintf(stderr, "Can't open port: %s\n", DEFAULT_PORT);            return;        }    }    //    // Open the file to be downloaded.    //    pFile = fopen(argv[1], "rb");    if(!pFile)    {        fprintf(stderr, "Could not open file '%s'.\n", argv[1]);        return;    }    //    // Get the size of the file.    //    fseek(pFile, 0, SEEK_END);    lFileSize = ftell(pFile);    fseek(pFile, 0, SEEK_SET);    //    // Allocate memory to hold the file contents.    //    pcFile = (char *)malloc(lFileSize);    if(!pcFile)    {        fprintf(stderr, "Failed to allocate memory for the file.\n");        return;    }    //    // Read the contents of the file into memory.    //    if(fread(pcFile, 1, lFileSize, pFile) != lFileSize)    {        fprintf(stderr, "Failed to read file '%s'.\n", argv[1]);        return;    }    //    // Close the file.    //    fclose(pFile);    //    // Get the baud rate divisor for the given baud rate.    //    SetBaud(lPort, 9600);    switch(lRate)    {        case 9600:        {            cRateChar = '0';            break;        }        case 19200:        {            cRateChar = '1';            break;        }        case 28800:        {            cRateChar = '2';            break;        }        case 38400:        {            cRateChar = '3';            break;        }        case 57600:        {            cRateChar = '4';            break;        }        case 115200:        {            cRateChar = '5';            break;        }    }    //    // Empty out the input queue.    //#ifdef CHAR_READY_IS_RELIABLE    while(CharReady(lPort))    {        cChar = ReceiveChar(lPort);    }#endif    //    // Tell the user to reset the board.    //    fprintf(stderr, "Waiting for the board to wakeup...");    //    // Wait until we read a '<' from the comm port.    //    WaitFor(lPort, '<');    //    // Tell the user that we are downloading the boot code.    //    fprintf(stderr, "\nDownloading boot code...(  0%%)");    //    // Write the boot code to the comm port.    //    for(lIdx = 0; lIdx < 2048; lIdx++)    {        //        // Write this character.        //        SendChar(lPort, pcBoot[lIdx]);        //        // Periodically print out our progress.        //        if((lIdx & 127) == 127)        {            fprintf(stderr, "\b\b\b\b\b%3d%%)", ((lIdx + 1) * 100) / 2048);        }    }                //    // Wait until we read a '>' from the comm port.    //    WaitFor(lPort, '>');    //    // Wait until we read a '?' from the comm port.    //    WaitFor(lPort, '?');    //    // Tell the boot code to switch to the desired baud rate.    //    SendChar(lPort, 'B');    SendChar(lPort, cRateChar);    //    // Wait until the output buffer is empty.    //    WaitForOutputEmpty();    //    // Switch our baud rate to the desired rate.    //    SetBaud(lPort, lRate);    //    // Send a '-' character until we receive back a '?' character.    //    while(1)    {        //        // Send a '-' character.        //        SendChar(lPort, '-');        //        // Wait a little bit.        //        for(lIdx = 0; lIdx < 1024 * 1024; lIdx++)        {        }        //        // See if there is a character waiting to be read.        //#ifdef CHAR_READY_IS_RELIABLE        if(CharReady(lPort))#else        if (1)#endif        {            //            // Read the character.            //            cChar = ReceiveChar(lPort);            //            // Quit waiting if this is a '?'.            //            if(cChar == '?')            {                break;            }        }    }    //    // Empty out the input queue.    //#ifdef CHAR_READY_IS_RELIABLE    while(CharReady(lPort))    {        cChar = ReceiveChar(lPort);    }#endif    //    // Send the program flash command.    //    SendChar(lPort, 'F');    //    // We always program the flash at location 0.    //    SendChar(lPort, 0);    SendChar(lPort, 0);    SendChar(lPort, 0);    SendChar(lPort, 0);    //    // Send the length of the data file.    //    SendChar(lPort, (char)(lFileSize & 0xFF));    SendChar(lPort, (char)((lFileSize >> 8) & 0xFF));    SendChar(lPort, (char)((lFileSize >> 16) & 0xFF));    SendChar(lPort, (char)((lFileSize >> 24) & 0xFF));    //    // Tell the user that we are downloading the file data.    //    fprintf(stderr, "\nDownloading file data...(  0%%)");    //    // Send the actual data in the file.    //    for(lIdx = 0; lIdx < lFileSize; lIdx++)    {        //        // Send this byte.        //        SendChar(lPort, pcFile[lIdx]);        //        // Periodically print out our progress.        //        if((lIdx & 127) == 127)        {            fprintf(stderr, "\b\b\b\b\b%3d%%)", ((lIdx + 1) * 100) / lFileSize);        }    }    //    // Tell the user that we are erasing the flash.    //    fprintf(stderr, "\nErasing the flash...(  0%%)");    //    // Wait until the flash has been erased.    //    cFirstChar = cChar = ReceiveChar(lPort);    while(cChar != '1')    {        //        // Print out our progress.        //        fprintf(stderr, "\b\b\b\b\b%3d%%)",               ((cFirstChar - cChar + 1) * 100) / (cFirstChar - '0'));        fprintf(stderr, "%c\n", cChar);        //        // Read a character from the boot code.        //        cChar = ReceiveChar(lPort);    }    //    // Tell the user that we are programming the flash.    //    fprintf(stderr, "\nProgramming the flash...(  0%%)");    //    // Wait until the flash has been programmed.    //    lIdx = 0;    while(1)    {        //        // Read a character from the boot code.        //        cChar = ReceiveChar(lPort);        //        // If the character is a '?', then we are done.        //        if(cChar == '?')        {            break;        }        //        // Print out our progress.        //        fprintf(stderr, "\b\b\b\b\b%3d%%)",               (++lIdx * 100) / ((lFileSize + 1023) / 1024));    }    //    // Tell the user we are done.    //    fprintf(stderr, "\nSuccessfully downloaded '%s'.\n", argv[1]);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线一区二区| 一区二区在线观看免费| 91久久国产最好的精华液| 精品制服美女久久| 首页国产丝袜综合| 午夜精品久久久久久久久| 亚洲夂夂婷婷色拍ww47 | 亚洲欧美色一区| 久久精品网站免费观看| 欧美精品一区视频| 久久蜜桃av一区二区天堂| www国产成人免费观看视频 深夜成人网| 777色狠狠一区二区三区| 精品视频全国免费看| 欧美日韩一区二区三区在线看| 欧美亚洲另类激情小说| 欧美日韩国产小视频| 欧美精品自拍偷拍| 日韩免费高清电影| 国产亚洲精品久| 国产精品久久久一本精品| 亚洲人成在线观看一区二区| 亚洲乱码精品一二三四区日韩在线| 国产精品久久久久久亚洲伦| 亚洲欧美日韩一区二区三区在线观看| 亚洲人123区| 五月婷婷综合在线| 九九九久久久精品| 99国产精品视频免费观看| 欧美午夜视频网站| 日韩一级免费观看| 国产校园另类小说区| 国产精品久久久久久久久免费樱桃| 最新中文字幕一区二区三区| 亚洲午夜一区二区| 国内不卡的二区三区中文字幕| 风间由美中文字幕在线看视频国产欧美| 99在线精品观看| 91.com在线观看| 国产精品久久久久影院亚瑟| 亚洲成人你懂的| 国产精品一线二线三线精华| 色综合av在线| 久久亚洲一级片| 亚洲福利视频导航| 国产精品18久久久久久久久久久久| 92国产精品观看| 欧美精品一区二区三区四区 | 久久久久久99精品| 一区二区三区色| 狠狠色丁香婷婷综合| 色综合久久久久综合体桃花网| 欧美放荡的少妇| 国产精品全国免费观看高清| 日韩专区一卡二卡| 色综合色狠狠天天综合色| 久久你懂得1024| 视频精品一区二区| 日本高清不卡一区| 国产嫩草影院久久久久| 奇米色777欧美一区二区| 91蜜桃免费观看视频| 国产日韩三级在线| 麻豆久久一区二区| 8v天堂国产在线一区二区| 亚洲一线二线三线久久久| 成人永久免费视频| 国产亚洲一区二区三区四区| 蜜臀久久久久久久| 欧美日韩视频专区在线播放| 亚洲欧美电影院| 播五月开心婷婷综合| 久久这里只精品最新地址| 日本特黄久久久高潮| 欧美日韩精品一区二区三区蜜桃 | 亚洲图片欧美激情| 粉嫩av亚洲一区二区图片| 久久综合狠狠综合久久综合88 | 欧美亚洲国产bt| 亚洲欧美偷拍三级| 色视频欧美一区二区三区| 国产精品久久久99| 波多野结衣一区二区三区 | 国产精品久久久久久一区二区三区| 老色鬼精品视频在线观看播放| 6080亚洲精品一区二区| 日韩精品电影在线| 日韩你懂的在线观看| 久久国产精品免费| 久久久久久久久久久久电影 | 日韩av在线免费观看不卡| 欧美日韩1234| 日本亚洲三级在线| 久久无码av三级| 国产在线精品一区二区 | 国产成人免费高清| 久久精品亚洲一区二区三区浴池| 国产精品资源站在线| 国产精品欧美一区二区三区| 99精品视频中文字幕| 一区二区三区四区精品在线视频| 欧美性极品少妇| 久久精品免费观看| 国产人伦精品一区二区| 色综合欧美在线视频区| 视频精品一区二区| 国产欧美一区二区精品婷婷| 91玉足脚交白嫩脚丫在线播放| 亚洲一区二区三区小说| 日韩欧美国产综合一区| av中文字幕在线不卡| 亚洲国产精品一区二区久久| 精品国产乱子伦一区| 99综合电影在线视频| 人妖欧美一区二区| 国产精品国产三级国产普通话99 | 成人av资源在线| 婷婷久久综合九色综合绿巨人| 日韩欧美成人激情| 91碰在线视频| 美女久久久精品| 亚洲人成在线播放网站岛国| 日韩欧美久久一区| 91看片淫黄大片一级在线观看| 日本美女视频一区二区| 国产精品网站在线| 欧美成人精品二区三区99精品| 97精品超碰一区二区三区| 美日韩一区二区| 一区二区三区在线高清| 久久精品亚洲麻豆av一区二区 | 亚洲一区二区三区中文字幕| 26uuuu精品一区二区| 欧美日韩国产综合一区二区三区| 国产精品一线二线三线| 日本不卡中文字幕| 亚洲午夜激情av| 亚洲日本成人在线观看| 久久免费国产精品| 日韩欧美国产一二三区| 在线观看成人小视频| 99久久免费国产| 国产**成人网毛片九色| 国产一区二区三区香蕉 | 日韩一区二区视频在线观看| 色综合久久88色综合天天 | 成人精品小蝌蚪| 国产自产视频一区二区三区| 天堂成人免费av电影一区| 亚洲一区二区视频在线观看| 国产精品久久久久久妇女6080| 久久久久九九视频| 久久久影视传媒| 久久伊人中文字幕| 久久尤物电影视频在线观看| 精品福利一区二区三区免费视频| 51精品秘密在线观看| 6080yy午夜一二三区久久| 欧美日韩精品一区二区三区四区 | 高清在线不卡av| 国产精品一区二区果冻传媒| 经典三级在线一区| 国产美女主播视频一区| 国产夫妻精品视频| 粉嫩一区二区三区性色av| 成人免费毛片aaaaa**| av午夜一区麻豆| 色狠狠一区二区| 精品视频1区2区| 日韩欧美高清dvd碟片| 欧美精品一区二区三区四区| 国产亚洲欧美日韩日本| 国产精品乱人伦中文| 亚洲女爱视频在线| 天天影视涩香欲综合网| 麻豆国产91在线播放| 国产剧情一区二区| 99久久精品国产精品久久 | 亚洲综合色丁香婷婷六月图片| 亚洲伊人伊色伊影伊综合网| 日产欧产美韩系列久久99| 奇米一区二区三区| 国产成人免费网站| 91成人在线精品| 欧美成人精品3d动漫h| 国产精品伦一区| 亚洲成人精品影院| 国产一区二区三区观看| 国产精品一区二区免费不卡 | 中文字幕成人av| 亚洲美女电影在线| 老司机精品视频在线| 福利电影一区二区三区| 欧美丝袜丝交足nylons图片| 精品国产91九色蝌蚪| 亚洲精品乱码久久久久久久久 | 午夜精品影院在线观看| 激情另类小说区图片区视频区| 97久久超碰精品国产| 91精品国产综合久久久久|