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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? flashpic.c

?? 《嵌入式固件開發(fā)》一書的源碼
?? C
字號:
/* flashpic.c:   This file contains the flash-support code that is relocated to   RAM prior to execution.  This file supports all bus widths, dependent   on the definition of WIDTH8, WIDTH16, or WIDTH32 on the command line.   Refer to flash.h for definition of the width-dependent macros.*/#include "cpu.h"#include "flashdev.h"#include "flash.h"#include "config.h"#include "stddefs.h"#if INCLUDE_FLASH/* Flasherase():   Based on the 'snum' value, erase the appropriate sector(s).   Return 0 if success, else -1.*/intFLASHERASE(struct flashinfo *fdev,int snum){    ftype   val;    ulong   add;    int ret, sector;    ret = 0;    add = (ulong)(fdev->base);    /* Erase the request sector(s): */    for (sector=0;sector<fdev->sectorcnt;sector++) {        if ((!FlashProtectWindow) &&            (fdev->sectors[sector].protected)) {            add += fdev->sectors[sector].size;            continue;        }        if ((snum == ALL_SECTORS) || (snum == sector)) {            /* Issue the sector erase command sequence: */            Write_aa_to_5555();            Write_55_to_2aaa();            Write_80_to_5555();            Write_aa_to_5555();            Write_55_to_2aaa();            Write_30_to_(add);                /* Wait for sector erase to complete or timeout.. */            /* DQ7 polling: wait for D7 to be 1. */            /* DQ6 toggling: wait for D6 to not toggle. */            /* DQ5 timeout: if DQ7 is 0, and DQ5 = 1, timeout. */            while(1) {                if (Is_ff(add)) {                    if (Is_ff(add))                        break;                }                if (D5_Timeout(add)) {                    if (Is_not_ff(add))                        ret = -1;                    break;                }            }        }        add += fdev->sectors[sector].size;    }    /* If the erase failed for some reason, then issue the read/reset */    /* command sequence prior to returning... */    if (ret == -1) {        Write_aa_to_5555();        Write_55_to_2aaa();        Write_f0_to_5555();        val = Read_5555();    }    return(ret);}/* EndFlasherase():   Function place holder to determine the "end" of the   sectorerase() function.*/voidENDFLASHERASE(){}/* Flashwrite():   Return 0 if successful, else -1.   Note: this assumes that source & destination properly aligned   based on the width of the flash bank.*/intFLASHWRITE(struct flashinfo *fdev,ftype *dest,ftype *src,long bytecnt){    int i, ret;    ftype   val;    /* Each pass through this loop writes 'fdev->width' bytes... */    ret = 0;    for (i=0;i<bytecnt;i+=fdev->width) {        /* Flash write command */        Write_aa_to_5555();        Write_55_to_2aaa();        Write_a0_to_5555();        /* Write the value */        Fwrite(dest,src);        /* Wait for write to complete or timeout. */        while(1) {            if (Is_Equal(dest,src)) {                if (Is_Equal(dest,src))                    break;            }            /* Check D5 for timeout... */            if (D5_Timeout(dest)) {                if (Is_Not_Equal(dest,src))                    ret = -1;                goto done;            }        }        dest++; src++;    }done:    /* Read/reset command: */    Write_aa_to_5555();    Write_55_to_2aaa();    Write_f0_to_5555();    val = Read_5555();    return(ret);}/* EndFlashwrite():    Function place holder to determine the "end" of the    Flashwrite() function.*/voidENDFLASHWRITE(){}/* Ewrite():   Erase all sectors that are part of the address space to be written,   then write the data to that address space.  This is basically a   concatenation of flasherase and flashwrite done in one step.  This is   necessary primarily for re-writing the bootcode; because after the boot   code is erased, there is nowhere to return so the re-write must be done   while executing out of ram also.*/intFLASHEWRITE(struct flashinfo *fdev,ftype *dest,ftype *src,int bytecnt){    int i;    ulong   add;    void    (*reset)();    ftype   val, *src1, *dest1;    add = (ulong)(fdev->base);    src1 = src;    dest1 = dest;    /* For each sector, if it overlaps any of the destination space */    /* then erase that sector. */    for (i=0;i<fdev->sectorcnt;i++) {        if ((((uchar *)dest) > (fdev->sectors[i].end)) ||            (((uchar *)dest+bytecnt-1) < (fdev->sectors[i].begin))) {            add += fdev->sectors[i].size;            continue;        }        /* Sector erase command: */        Write_aa_to_5555();        Write_55_to_2aaa();        Write_80_to_5555();        Write_aa_to_5555();        Write_55_to_2aaa();        Write_30_to_(add);            /* Wait for sector erase to complete or timeout.. */        /* DQ7 polling: wait for D7 to be 1. */        /* DQ6 toggling: wait for D6 to not toggle. */        /* DQ5 timeout: if DQ7 is 0, and DQ5 = 1, timeout. */        while(1) {            if (Is_ff(add)) {                if (Is_ff(add))                    break;            }            /* Check D5 for timeout... */            /* In this case, there is nothing to return to */            /* because the flash was just erased, so just break.*/            if (D5_Timeout(add)) {                goto quit;            }        }        add += fdev->sectors[i].size;    }    /* Read/reset command: */    Write_aa_to_5555();    Write_55_to_2aaa();    Write_f0_to_5555();    val = Read_5555();    for(i=0;i<bytecnt;i+=fdev->width) {        /* Write command: */        Write_aa_to_5555();        Write_55_to_2aaa();        Write_a0_to_5555();        Fwrite(dest,src);        while(1) {            if (Is_Equal(dest,src)) {                if (Is_Equal(dest,src))                    break;            }            /* Check D5 for timeout... */            if (D5_Timeout(dest)) {                if (Is_Not_Equal(dest,src))                    goto quit;                continue;            }        }        dest++; src++;    }quit:    /* Issue the read/reset command sequence: */    Write_aa_to_5555();    Write_55_to_2aaa();    Write_f0_to_5555();    val = Read_5555();    /* Wait till flash is readable, or timeout: */    for(i=0;i<FLASH_TIMEOUT;i++) {        if (Is_Equal(dest1,src1))            break;    }    /* Now that the re-programming of flash is complete, reset: */    reset = RESETFUNC();    reset();    return(0);  /* won't get here */}/* EndFlashewrite():    Function place holder to determine the "end" of the    FlashEraseAndWrite() function.*/voidENDFLASHEWRITE(){}/* Flashtype():   Use the AUTOSELECT command sequence to determine the type of device.   Note: there is one additional step that I found necessary to keep   SGS29040 device happy... For some reason after issuing the read/reset   command and returning (to code that actually executes out of the FLASH   device) I was consistently getting an illegal opcode exception at   the return location in the flash.  It appears that the SGS part needs   a bit of time after the read/reset to be able to fetch an instruction.   Reading a value in the flash (stored in val) prior to issuing the   command sequence, then waiting for that read to be the same after    issuing the read/reset, assures the algorithm of not returning unless   the flash device is readable.  Note that I found this ONLY to be necessary   for the signature read command of SGS flash.*/intFLASHTYPE(struct flashinfo *fdev){    volatile int    i;    ftype   val;    ushort  man, dev;    val = Read_0000();    /* Issue the autoselect command sequence: */    Write_aa_to_5555();    Write_55_to_2aaa();    Write_90_to_5555();        man = (ushort)Read_0000();  /* manufacturer ID */    dev = (ushort)Read_0001();  /* device ID */    man &= 0xff;    dev &= 0xff;    man <<=8;    dev |= man;    fdev->id = (ushort)dev;    /* Issue the read/reset command sequence: */    Write_aa_to_5555();    Write_55_to_2aaa();    Write_f0_to_5555();    /* The SGS29040 seems to need this, and it doesn't hurt anything */    /* when using the AMD parts... */    for(i=0;i<FLASH_TIMEOUT;i++) {        if (val == Read_0000())            break;    }    return((int)(fdev->id));}/* EndFlashtype():    Function place holder to determine the "end" of the    Flashtype() function.*/voidENDFLASHTYPE(){}#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩三级在线| 国产精品综合久久| 日韩码欧中文字| 亚洲午夜激情av| 顶级嫩模精品视频在线看| 欧美三级电影在线观看| 欧美精品一区二区精品网| 一区二区在线观看不卡| 国产精品影视在线观看| 8x8x8国产精品| 一区二区三区蜜桃网| 国产+成+人+亚洲欧洲自线| 精品三级在线看| 视频一区在线播放| 欧美视频在线观看一区| 中文字幕日韩精品一区| 国产精品一二一区| 欧美不卡一区二区三区| 青青草国产精品97视觉盛宴| 色哦色哦哦色天天综合| 国产精品午夜在线| 国产成人av一区二区| 2020国产精品久久精品美国| 免费人成在线不卡| 欧美一级理论片| 日本成人中文字幕| 欧美日韩国产片| 亚洲国产精品综合小说图片区| 91麻豆蜜桃一区二区三区| 亚洲国产成人自拍| 不卡视频免费播放| 国产精品日日摸夜夜摸av| 成人福利在线看| 国产精品成人免费在线| a美女胸又www黄视频久久| 中文字幕欧美国产| 99麻豆久久久国产精品免费优播| 国产精品福利电影一区二区三区四区| 国产成人精品影视| 国产精品久久久久久亚洲毛片| 丁香激情综合国产| 中文字幕一区二区三中文字幕| 不卡的av电影在线观看| 亚洲免费av高清| 欧美视频在线播放| 久久精品国产99| 国产日产亚洲精品系列| 99久久伊人精品| 亚洲一区二区三区自拍| 日韩一区二区在线看| 韩国精品免费视频| 国产精品久久久久国产精品日日| 一本大道av一区二区在线播放| 亚洲综合久久久| 午夜精品福利一区二区蜜股av| 精品一区二区三区免费视频| 成人丝袜18视频在线观看| 国产精品每日更新| 欧美图片一区二区三区| 日本中文字幕一区二区视频| 在线视频国内一区二区| 国产日韩精品一区二区浪潮av | 成人丝袜高跟foot| 亚洲免费资源在线播放| 337p亚洲精品色噜噜| 国产精品 欧美精品| 伊人夜夜躁av伊人久久| 精品1区2区在线观看| 色婷婷亚洲精品| 精品亚洲国内自在自线福利| 亚洲欧洲精品天堂一级| 日韩三级视频中文字幕| 97久久人人超碰| 蜜臀av性久久久久蜜臀aⅴ| 国产精品日韩精品欧美在线| 欧美一区二区视频在线观看| 成人午夜在线免费| 美女爽到高潮91| 亚洲日本va在线观看| 日韩欧美一区电影| 欧美午夜片在线看| 国产sm精品调教视频网站| 婷婷激情综合网| 亚洲天堂精品视频| 久久精品网站免费观看| 制服丝袜成人动漫| 色婷婷综合久久久中文一区二区| 韩国女主播一区| 日韩av一级片| 亚洲精品视频免费观看| 国产欧美日韩在线视频| 日韩三级高清在线| 欧美日韩一区久久| 91日韩在线专区| 懂色一区二区三区免费观看| 久久精品免费观看| 午夜久久久久久久久| 亚洲美女在线国产| 国产精品第13页| 国产精品国产精品国产专区不蜜 | 亚洲人成在线观看一区二区| 2017欧美狠狠色| 欧美一级精品在线| 欧美情侣在线播放| 欧美人伦禁忌dvd放荡欲情| 色综合天天综合色综合av| 成人黄页毛片网站| 欧美另类一区二区三区| 色婷婷av一区| 色综合色狠狠综合色| 91尤物视频在线观看| 99精品在线观看视频| 成人福利在线看| 91视视频在线观看入口直接观看www | 日韩美女在线视频| 91.xcao| 91精品国产福利| 欧美一级日韩不卡播放免费| 9191成人精品久久| 日韩欧美国产综合一区| 日韩精品专区在线| 欧美r级电影在线观看| 欧美成人高清电影在线| 精品免费99久久| 337p日本欧洲亚洲大胆色噜噜| 久久久久久久国产精品影院| 亚洲精品一区在线观看| 久久久亚洲高清| 国产精品国产馆在线真实露脸 | 亚洲视频一区在线| 亚洲免费在线看| 亚洲第一二三四区| 日本欧美一区二区三区| 狠狠色丁香婷婷综合久久片| 国产精品资源网| 99re成人精品视频| 555夜色666亚洲国产免| 久久久夜色精品亚洲| 亚洲欧美另类综合偷拍| 亚洲成人自拍网| 国产尤物一区二区在线| 成人爱爱电影网址| 欧美精品久久99| 国产偷v国产偷v亚洲高清| 亚洲嫩草精品久久| 奇米亚洲午夜久久精品| 国产夫妻精品视频| 欧美日韩亚洲综合| wwww国产精品欧美| 亚洲精品网站在线观看| 日韩国产欧美在线视频| 国产**成人网毛片九色 | 欧美日韩综合不卡| 精品国产电影一区二区| 亚洲日本成人在线观看| 精品一区二区三区蜜桃| 色婷婷激情一区二区三区| 精品电影一区二区三区| 亚洲毛片av在线| 国产成人午夜精品5599 | 国产视频一区在线观看| 亚洲自拍另类综合| 国产成人免费高清| 91精品国产综合久久蜜臀| 国产精品久久久久一区 | 欧美精品一区二区久久久| 一区二区三区在线观看网站| 精品一区二区三区在线观看| 91国产丝袜在线播放| 久久精品人人做| 免费看黄色91| 在线亚洲免费视频| 国产日韩亚洲欧美综合| 久久se这里有精品| 欧美久久久影院| 亚洲男人都懂的| 成人综合在线视频| 2020国产精品久久精品美国| 日本欧美在线看| 欧美日韩成人在线| 一区二区在线看| 一本到高清视频免费精品| 国产女主播视频一区二区| 麻豆专区一区二区三区四区五区| 欧美性大战久久久久久久| 中文字幕一区二区三区在线不卡| 高清久久久久久| 精品国产免费视频| 久久99国产精品免费网站| 9191精品国产综合久久久久久| 亚洲一区二区三区影院| 91在线看国产| 亚洲视频在线观看三级| 99视频有精品| 亚洲男帅同性gay1069| 91成人免费电影| 亚洲小说欧美激情另类| 欧美日韩国产美| 日韩精品一区第一页| 日韩一区二区三区四区五区六区|