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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? flashpic.c

?? 《嵌入式固件開(kāi)發(fā)》一書(shū)的源碼
?? C
字號(hào):
/* 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_aaa();            Write_55_to_555();            Write_80_to_aaa();            Write_aa_to_aaa();            Write_55_to_555();            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_f0_to_base();        val = Read_555();    }    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_aaa();        Write_55_to_555();        Write_a0_to_aaa();        /* 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_f0_to_base();    val = Read_555();    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_aaa();        Write_55_to_555();        Write_80_to_aaa();        Write_aa_to_aaa();        Write_55_to_555();        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_f0_to_base();    val = Read_555();    for(i=0;i<bytecnt;i+=fdev->width) {        /* Write command: */        Write_aa_to_aaa();        Write_55_to_555();        Write_a0_to_aaa();        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_f0_to_base();    val = Read_555();    /* 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){    ushort  man, dev;    /* Issue the autoselect command sequence: */    Write_aa_to_aaa();    Write_55_to_555();    Write_90_to_aaa();        man = (ushort)Read_0000();  /* manufacturer ID */    dev = (ushort)Read_0002();  /* device ID */    man &= 0xff;    dev &= 0xff;    man <<=8;    dev |= man;    fdev->id = (ushort)dev;    /* Issue the read/reset command sequence: */    Write_f0_to_base();    return((int)(fdev->id));}/* EndFlashtype():    Function place holder to determine the "end" of the    Flashtype() function.*/voidEndFlashtype(){}#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国模娜娜一区二区三区| 国产精一区二区三区| 欧美另类一区二区三区| 奇米777欧美一区二区| 国产欧美中文在线| 91丨porny丨国产| 美女一区二区视频| 成人欧美一区二区三区视频网页 | 日韩欧美久久久| 懂色av一区二区三区免费看| 亚洲成人777| 亚洲国产高清aⅴ视频| 亚洲免费在线播放| 欧美一级片免费看| 不卡的av网站| 久久99精品一区二区三区三区| 亚洲国产精品二十页| 欧美美女喷水视频| 成人不卡免费av| 蜜桃久久久久久久| 一区二区三区蜜桃| 国产亚洲精久久久久久| 99久久精品免费看国产免费软件| 琪琪一区二区三区| 一区二区三区日本| 国产精品久久久久久久久免费相片| 91精品国产综合久久香蕉麻豆| www.99精品| 国产制服丝袜一区| 日本视频在线一区| 一区av在线播放| 成人欧美一区二区三区在线播放| 欧美一区二区三区免费在线看| 91免费在线视频观看| 免费欧美在线视频| 亚洲一级片在线观看| 国产日韩欧美综合在线| 日韩久久免费av| 有码一区二区三区| 国产精品入口麻豆原神| 久久久久久久久久久电影| 欧美日本不卡视频| 欧美性一级生活| 色婷婷一区二区三区四区| 成人少妇影院yyyy| 福利视频网站一区二区三区| 久久精品国产久精国产爱| 视频一区二区三区在线| 亚洲在线一区二区三区| 亚洲精选免费视频| 亚洲欧美激情一区二区| 国产精品电影一区二区三区| 国产日韩精品一区二区三区在线| 日韩免费高清av| 日韩亚洲欧美高清| 欧美一区二区三区四区视频 | 久久综合九色综合欧美就去吻| 欧美高清视频一二三区| 欧美日韩美女一区二区| 欧美视频一区二区三区四区| 色狠狠综合天天综合综合| 99久久亚洲一区二区三区青草| 国产成a人亚洲| 99在线视频精品| 色综合久久久久久久久久久| 在线视频你懂得一区| 欧美调教femdomvk| 欧美电影一区二区| 日韩一区二区电影| 久久人人超碰精品| 亚洲精品一区在线观看| 国产欧美精品一区| 久久午夜免费电影| 亚洲欧洲av在线| 一区二区三区自拍| 午夜久久电影网| 奇米色一区二区三区四区| 韩国女主播成人在线观看| 国产成人精品www牛牛影视| av日韩在线网站| 宅男在线国产精品| 9191国产精品| 久久综合五月天婷婷伊人| 国产三级欧美三级日产三级99| 中文在线免费一区三区高中清不卡| 综合欧美亚洲日本| 亚洲成人av电影在线| 久久99热99| 99精品偷自拍| 91麻豆精品国产91久久久更新时间| 亚洲精品一区二区三区蜜桃下载 | 欧美xxxx在线观看| 中文子幕无线码一区tr| 一区二区三区四区国产精品| 奇米四色…亚洲| 99久久久久久| 日韩午夜电影av| 国产日韩三级在线| 亚洲一二三区在线观看| 久久精品国产亚洲高清剧情介绍 | av在线一区二区| 欧美一区2区视频在线观看| 国产女同互慰高潮91漫画| 亚洲一区二区三区四区五区中文| 麻豆91小视频| 色综合久久综合网欧美综合网| 欧美午夜电影在线播放| 日韩欧美国产三级| 亚洲欧美日韩国产手机在线| 亚洲综合在线免费观看| 国产专区综合网| 欧美挠脚心视频网站| 国产精品丝袜久久久久久app| 午夜精品一区在线观看| 国产黑丝在线一区二区三区| 在线91免费看| 玉足女爽爽91| 白白色亚洲国产精品| 欧美成va人片在线观看| 一区二区三区精密机械公司| 国产精品自拍在线| 欧美一级二级三级蜜桃| 亚洲精选视频在线| 成人av资源在线观看| 精品日产卡一卡二卡麻豆| 亚洲自拍另类综合| 99久久国产综合精品麻豆| 精品99久久久久久| 裸体歌舞表演一区二区| 欧美人伦禁忌dvd放荡欲情| 国产精品国产三级国产普通话蜜臀| 美女视频免费一区| 制服丝袜激情欧洲亚洲| 一级中文字幕一区二区| 国产精品中文字幕日韩精品 | 久久精品一二三| 麻豆传媒一区二区三区| 日韩一区二区三区电影| 午夜电影久久久| 欧美性大战久久| 亚洲激情第一区| 成人app网站| 久久久影院官网| 黄色小说综合网站| 日韩一区二区三区在线观看| 亚洲狠狠丁香婷婷综合久久久| 国产馆精品极品| 国产精品视频一区二区三区不卡| 国产精品一区免费在线观看| 日韩免费电影一区| 韩国女主播成人在线| 久久综合久久综合亚洲| 精品一区二区三区的国产在线播放| 日韩欧美精品在线| 免费久久99精品国产| 日韩女优电影在线观看| 久久精品99国产国产精| 欧美mv日韩mv国产网站| 国产一区二三区好的| 国产亚洲一二三区| 成人福利视频网站| 自拍偷在线精品自拍偷无码专区| 色综合天天综合网天天看片| 国产精品久久久久影院亚瑟 | av综合在线播放| 一区二区三区免费网站| 色婷婷亚洲婷婷| 一二三区精品视频| 91久久一区二区| 激情小说亚洲一区| 国产欧美日韩精品在线| 色诱亚洲精品久久久久久| 夜夜亚洲天天久久| 日韩一区二区视频| 粉嫩一区二区三区性色av| 国产精品情趣视频| 色婷婷av一区| 欧美a级一区二区| 精品成人一区二区| 成人免费高清在线| 一区二区三区四区精品在线视频| 欧美日韩国产另类不卡| 国产专区综合网| 亚洲一级电影视频| 欧美r级电影在线观看| av亚洲精华国产精华精华| 亚洲成人av免费| 国产亚洲一区二区三区| 色就色 综合激情| 精品在线观看视频| 中文子幕无线码一区tr| 91精品国产欧美一区二区成人| 国产风韵犹存在线视精品| 亚洲精品日韩综合观看成人91| 日韩三级在线免费观看| 国产成人av影院| 香蕉成人伊视频在线观看| 久久久91精品国产一区二区精品| 日本精品一级二级| 国模套图日韩精品一区二区|