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

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

?? upsd3400_usb_app.lst

?? uPSD34xx Disk driver
?? LST
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
 300          
 301           How it works:
 302           This SW burns data into internal uPSD NOR FLASH. To save FLASH RW cycles,
 303           it is looking for empty sector part you are burning in.
C51 COMPILER V7.50   UPSD3400_USB_APP                                                      09/13/2005 18:00:20 PAGE 6   

 304           If the area is filled by 0xFF only, the sector part is assumed
 305           to be erased before, so only data are written directly to the selected flash
 306           sector.
 307           If not, the sector is copied to the last flash sector #8,
 308           erased afterwards and written back (with the updated data block).
 309           ******************************************************************************/
 310           {
 311   1        data unsigned char j,page;
 312   1        data unsigned int i,SectorEndPhysicalDataAddr;
 313   1      
 314   1      
 315   1        UPSD_xreg.DATAOUT_D = 0;                   // WRITE, RED LED ON !
 316   1      
 317   1        if (TransferLength != 0)
 318   1         {
 319   2                                                   // Test the block (following 64B).
 320   2          USEL  = OUTDIR | UMSC_OUT_ENDPOINT;      // Select EP3 OUT
 321   2      
 322   2          i = PhysicalDataAddr;
 323   2          j = 0;
 324   2      // now check whether is necessary to erase the block or not; it saves Flash RW cycles
 325   2          while (j<64)
 326   2           {
 327   3            if (( ( ((unsigned char volatile xdata *) 0)[i]) | USB_FIFO[j]) != 0xFF)
 328   3             {
 329   4              j = 255;
 330   4             }
 331   3            else
 332   3             {
 333   4              i++;
 334   4              j++;
 335   4             }
 336   3           }
 337   2      
 338   2      
 339   2          if (j == 255)             //check whether the sector needs to be erased or not
 340   2           {
 341   3            page = UPSD_xreg.PAGE;
 342   3            UPSD_xreg.PAGE = 7;
 343   3      
 344   3            EraseMainFlashSector();                //erase sector #8;
 345   3                                        //now calculate the max. FLASH area to be erased
 346   3                 //TransferLength holds number of 64B packets to be received and written
 347   3            if ((TransferLength>=512) || ((PhysicalDataAddr+(TransferLength<<6))<0x8000))
 348   3             {
 349   4              SectorEndPhysicalDataAddr = 0xFFFF;  //the top of memory
 350   4             }
 351   3            else
 352   3             {
 353   4              SectorEndPhysicalDataAddr = PhysicalDataAddr+(((unsigned int)TransferLength)<<6)-1;
 354   4             }
 355   3      
 356   3      
 357   3            UPSD_xreg.PAGE = page;                 // the sector part needs to be erased
 358   3            i = 0x8000;               //now copy the FLASH sector to the flash sector #8
 359   3            while (i != 0)   //  copy only the area without the part we are updating now
 360   3             {
 361   4              if ((i<PhysicalDataAddr) || (i>SectorEndPhysicalDataAddr))    //write back
 362   4               {
 363   5                j = ((unsigned char volatile xdata *) 0)[i];
 364   5                if (j != 0xFF)                     // do not write 0xFF
 365   5                 {
C51 COMPILER V7.50   UPSD3400_USB_APP                                                      09/13/2005 18:00:20 PAGE 7   

 366   6                  UPSD_xreg.PAGE = 7;
 367   6                  if (WriteToMainFlash(i,j) == TRUE)
 368   6                   {
 369   7                    gbCSWStatus = FAIL;          //error during write operation occured!
 370   7                    i = 0xFFFF;
 371   7                   }
 372   6                  UPSD_xreg.PAGE = page;
 373   6                 }
 374   5               }
 375   4              i++;                           // this area will be replaced by a new data
 376   4             }
 377   3      
 378   3            EraseMainFlashSector();                // erase sector
 379   3      
 380   3      
 381   3      // now we have a copy of data in the sector #8 with the erase area we need to update
 382   3      
 383   3            i = 0x8000;
 384   3            while (i != 0)              //copy the rest of data back to the orig. sector
 385   3             {
 386   4              UPSD_xreg.PAGE = 7;
 387   4              j = ((unsigned char volatile xdata *) 0)[i];
 388   4              if (j != 0xFF)                       // do not write 0xFF, already present
 389   4               {
 390   5                UPSD_xreg.PAGE = page;
 391   5                if (WriteToMainFlash(i,j) == TRUE)
 392   5                 {
 393   6                  gbCSWStatus = FAIL;            //error during write operation occured!
 394   6                  i = 0xFFFF;                      //end loop
 395   6                 }
 396   5               }
 397   4              i++;
 398   4             }
 399   3      
 400   3            UPSD_xreg.PAGE = page;
 401   3           }
 402   2      
 403   2      
 404   2      // Now the sector is ready for write
 405   2      
 406   2          i = PhysicalDataAddr;
 407   2          j =0;
 408   2          while (j<64)                             //now burn the data into flash
 409   2           {
 410   3            if (WriteToMainFlash(i,~USB_FIFO[j]) == TRUE)
 411   3             {
 412   4                                                   // an error occured, try it again
 413   4              gbCSWStatus = FAIL;                //error during write operation occured!
 414   4              j = 255;
 415   4             }
 416   3            else
 417   3             {
 418   4              i++;
 419   4              j++;
 420   4             }
 421   3           }
 422   2      
 423   2      
 424   2          UCON |= EPFIFO_BSY;
 425   2      
 426   2      
 427   2          SpecificIncrementSectorAddress();
C51 COMPILER V7.50   UPSD3400_USB_APP                                                      09/13/2005 18:00:20 PAGE 8   

 428   2         }
 429   1      
 430   1        if (TransferLength == 0)
 431   1         {
 432   2          ReturnCSW();                             // return status
 433   2         }
 434   1      
 435   1        UPSD_xreg.DATAOUT_D = 255;                 // WRITE done, RED LED OFF !
 436   1       }
 437          
 438          void ReadBufferFromFlash(void)
 439          /******************************************************************************
 440           Function   : void ReadBufferFromFlash()
 441           Parameters : (none)
 442           Description: Reads (sends) TransferLength sectors with length of 512 bytes
 443           ******************************************************************************/
 444           {
 445   1      
 446   1      
 447   1        if (TransferLength == 0)
 448   1         {
 449   2          ReturnCSW();                             // return status
 450   2         }
 451   1        else
 452   1         {
 453   2      #ifdef __RC51__                              //Compiler: Raisonance
                    #pragma asm
                      ;The following equates are also defined in usb.h
                      ; and should be the same in both places.
                              ;The following EQUates are only needed when using RIDE. 
                            USB_BASE_ADDR    EQU 7000H    ;USB FIFO mapped in XDATA space
                            INDIR            EQU 0
                            SELEP1           EQU 1
                            UMSC_IN_ENDPOINT EQU SELEP1
                    #pragma endasm
              #endif
 464   2            #pragma asm
 465   2                    mov    DPTM,#0
 466   2                    mov    DPTC,#1
 467   2                    mov    DPH,PhysicalDataAddr+0
 468   2                    mov    DPL,PhysicalDataAddr+1
 469   2                    mov    DPTM,#10
 470   2                    mov    USEL,#INDIR+UMSC_IN_ENDPOINT
 471   2                    mov    DPTC,#0
 472   2                    mov    DPTR,#USB_BASE_ADDR
 473   2                    mov    DPTC,#64+1
 474   2                    mov    B,#64
 475   2                    movx   A,@DPTR
 476   2                    cpl    A
 477   2                    movx   @DPTR,A
 478   2                    djnz   B,$-3
 479   2                    mov    USIZE,#64                                         ; FIRE!
 480   2                    mov    DPTM,#0
 481   2                    mov    DPTC,#0
 482   2            #pragma endasm
 483   2            SpecificIncrementSectorAddress();
 484   2      
 485   2      /*gbCSWStatus = FAIL;*/
 486   2         }
 487   1       }
 488          
 489          void DoReadWrite(void)
C51 COMPILER V7.50   UPSD3400_USB_APP                                                      09/13/2005 18:00:20 PAGE 9   

 490          /*--------------------------------------------------------------------
 491            Function   : void DoReadWrite()
 492            Parameters : none
 493            Description: Handler for READ and WRITE command
 494            ---------------------------------------------------------------------*/
 495           {
 496   1        data unsigned long LogicalBlockAddr;
 497   1      
 498   1      /* Decode the Command Descriptor Block (CDB)
 499   1        Byte 0 OPERATION CODE
 500   1        Byte 1 Reserved
 501   1        Byte 2,3,4,5 (MSB) LOGICAL BLOCK ADDRESS (LSB)
 502   1        Byte 6 Reserved
 503   1        Byte 7 (MSB)
 504   1        Byte 8 TRANSFER LENGTH (LSB)
 505   1        Byte 9 CONTROL = 00h
 506   1        The LOGICAL BLOCK ADDRESS field specifies the first logical block of the range
 507   1        of logical blocks that shall be read.
 508   1        The TRANSFER LENGTH field specifies the number of contiguous logical blocks of
 509   1        data that shall be transferred. A TRANSFER LENGTH of zero indicates that no logical
 510   1        blocks shall be transferred. This condition shall not be considered an error.
 511   1        Any other value indicates the number of logical blocks that shall be transferred.
 512   1        */
 513   1        LogicalBlockAddr  = *(unsigned long int *)&gbCBWCB[2];
 514   1      
 515   1        PhysicalDataAddr =  ((unsigned int )(LogicalBlockAddr << 9)) | 0x8000;
 516   1        UPSD_xreg.PAGE   =   (unsigned char)(LogicalBlockAddr >> 6);
 517   1        TransferLength   =  *(unsigned int *)&gbCBWCB[7];
 518   1        TransferLength   = TransferLength*8;
 519   1      
 520   1        gbBulkPipeStage  = BS_DATA_PHASE;
 521   1      
 522   1        if (gbCBWFlags & 0x80)                     // READ command
 523   1         {
 524   2          ReadBufferFromFlash();
 525   2         }
 526   1       }
 527          
 528          void OnRequestSense(void)
 529          /*--------------------------------------------------------------------
 530           Function   : void OnRequestSense()
 531           Parameters : none
 532           Description: Handler for RequestSense command
 533                  The REQUEST SENSE command requests that the device server
 534                        transfer sense data to the application client.
 535          ---------------------------------------------------------------------*/
 536           {
 537   1        USEL  = INDIR | UMSC_IN_ENDPOINT;          //Select EP1 IN
 538   1      
 539   1        USB_FIFO[ 0] = 0x70;
 540   1        USB_FIFO[ 1] = 0x00;
 541   1        USB_FIFO[ 2] = 0x03;                       //sense key
 542   1        USB_FIFO[ 3] = 0x00;
 543   1        USB_FIFO[ 4] = 0x00;
 544   1        USB_FIFO[ 5] = 0x00;
 545   1        USB_FIFO[ 6] = 0x00;
 546   1        USB_FIFO[ 7] = 0x0A;                       //additional Length
 547   1        USB_FIFO[ 8] = 0x00;
 548   1        USB_FIFO[ 9] = 0x00;
 549   1        USB_FIFO[10] = 0x00;
 550   1        USB_FIFO[11] = 0x00;
 551   1        USB_FIFO[12] = 0x30;                       //ASC
C51 COMPILER V7.50   UPSD3400_USB_APP                                                      09/13/2005 18:00:20 PAGE 10  

 552   1        USB_FIFO[13] = 0x01;                       //ASCQ
 553   1        USB_FIFO[14] = 0x00;
 554   1        USB_FIFO[15] = 0x00;
 555   1        USB_FIFO[16] = 0x00;
 556   1        USB_FIFO[17] = 0x00;
 557   1      
 558   1        USIZE = 18;
 559   1      
 560   1        gbBulkPipeStage = BS_CSW_PHASE;
 561   1       }
 562          
 563          void OnInquiry(void)
 564          /*--------------------------------------------------------------------
 565           Function   : void OnInquiry()
 566           Parameters : none
 567           Description: Handler for Inquiry command
 568          ---------------------------------------------------------------------*/
 569           {
 570   1        USEL  = INDIR | UMSC_IN_ENDPOINT;          //Select EP1 IN
 571   1        USB_FIFO[ 0] = 0x00;
 572   1        USB_FIFO[ 1] = 0x80;                   //b7 = RMB = 1 if the medium is removable
 573   1        USB_FIFO[ 2] = 0x00;
 574   1        USB_FIFO[ 3] = 0x01;
 575   1      
 576   1        USB_FIFO[ 4] = 36-4;                       //additional Length (n-4)
 577   1        USB_FIFO[ 5] = 0x80;
 578   1        USB_FIFO[ 6] = 0x00;
 579   1        USB_FIFO[ 7] = 0x01;
 580   1      
 581   1      #ifdef DK3400
 582   1        USB_FIFO[ 8] = 'S';                        //Vendor Information
 583   1        USB_FIFO[ 9] = 'T';
 584   1        USB_FIFO[10] = ' ';
 585   1        USB_FIFO[11] = ' ';
 586   1        USB_FIFO[12] = ' ';
 587   1        USB_FIFO[13] = ' ';
 588   1        USB_FIFO[14] = ' ';
 589   1        USB_FIFO[15] = ' ';
 590   1      
 591   1        USB_FIFO[16] = 'D';                        //Product Identification
 592   1        USB_FIFO[17] = 'K';
 593   1        USB_FIFO[18] = '3';
 594   1        USB_FIFO[19] = '4';
 595   1        USB_FIFO[20] = '0';
 596   1        USB_FIFO[21] = '0';
 597   1        USB_FIFO[22] = ' ';
 598   1        USB_FIFO[23] = 'D';
 599   1        USB_FIFO[24] = 'e';
 600   1        USB_FIFO[25] = 'm';
 601   1        USB_FIFO[26] = 'o';
 602   1        USB_FIFO[27] = ' ';
 603   1        USB_FIFO[28] = ' ';
 604   1        USB_FIFO[29] = ' ';
 605   1        USB_FIFO[30] = ' ';

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一级黄色片| 美国毛片一区二区| 首页亚洲欧美制服丝腿| 日韩精品一二三四| 国产在线精品免费| 99re成人精品视频| 欧美日韩不卡一区| 久久精品日产第一区二区三区高清版| 久久婷婷国产综合国色天香| 国产精品毛片无遮挡高清| 亚洲图片有声小说| 国产精品99久久久久久宅男| 色婷婷久久综合| 久久影视一区二区| 国产精品一级二级三级| 欧美最猛黑人xxxxx猛交| 欧美xxxxxxxx| 亚洲国产精品久久久久婷婷884| 欧美大白屁股肥臀xxxxxx| 欧美精品一区二区三区很污很色的 | 在线观看亚洲a| 337p日本欧洲亚洲大胆精品| 亚洲欧洲美洲综合色网| 美女看a上一区| 欧美日高清视频| 中文字幕在线播放不卡一区| 麻豆国产欧美日韩综合精品二区 | 日韩欧美的一区| 亚洲成年人影院| 一本一道综合狠狠老| 久久久久久99精品| 久久99精品国产麻豆婷婷洗澡| 色欧美片视频在线观看| 国产视频一区在线观看| 国内一区二区在线| 欧美va亚洲va国产综合| 日韩成人一区二区| 欧美顶级少妇做爰| 亚洲成人自拍网| 欧美日韩一区三区| 亚洲综合清纯丝袜自拍| 欧美性xxxxxx少妇| 亚洲小说欧美激情另类| 91国产福利在线| 亚洲成人高清在线| 亚洲欧美综合色| 色一情一乱一乱一91av| 亚洲精品国产成人久久av盗摄| 99久久国产免费看| 亚洲一区二区不卡免费| 欧美日精品一区视频| 奇米色一区二区三区四区| 久久午夜电影网| 91久久精品一区二区三| 欧美aaaaaa午夜精品| 26uuu欧美日本| 一本色道综合亚洲| 日本在线不卡视频一二三区| 精品国产一区二区在线观看| 精品一区二区影视| 亚洲精品v日韩精品| 91精品免费观看| 99riav一区二区三区| 视频一区中文字幕| 国产精品理论在线观看| 欧美日韩亚洲综合在线| 国产精品三级久久久久三级| 久久精品二区亚洲w码| 精品国产sm最大网站| 91国产福利在线| 亚洲综合999| 国产亚洲va综合人人澡精品| 欧美在线|欧美| 国产精品资源网| 午夜精品一区二区三区免费视频 | 久久不见久久见中文字幕免费| 国产精品免费免费| 日韩亚洲欧美在线观看| 色综合久久久久综合体桃花网| 国产永久精品大片wwwapp| 青青草伊人久久| 亚洲国产美国国产综合一区二区| 国产偷国产偷亚洲高清人白洁| 欧美日韩国产免费一区二区| 91丨porny丨在线| a亚洲天堂av| 国产成人av电影| 国产成人免费视频精品含羞草妖精| 日韩精品午夜视频| 天天综合网天天综合色| 亚洲欧美另类综合偷拍| 1024成人网| 亚洲乱码中文字幕综合| 国产精品无圣光一区二区| 久久久久久久av麻豆果冻| 欧美mv日韩mv亚洲| 久久久噜噜噜久噜久久综合| 久久综合色之久久综合| 精品日韩在线观看| 国产色一区二区| 国产精品拍天天在线| 国产精品女主播av| 日韩一区欧美一区| 亚洲午夜一区二区三区| 五月天中文字幕一区二区| 天堂av在线一区| 麻豆国产一区二区| 国产99久久久国产精品免费看| 成人午夜激情视频| 欧美色综合影院| 日韩免费在线观看| 国产精品污污网站在线观看| 一区精品在线播放| 午夜欧美电影在线观看| 首页国产欧美日韩丝袜| 国产精品亚洲一区二区三区在线| 北条麻妃国产九九精品视频| 91麻豆6部合集magnet| 欧美一区二区三区播放老司机| 久久综合九色综合久久久精品综合| 久久久精品一品道一区| 亚洲尤物在线视频观看| 久草精品在线观看| 色婷婷久久久久swag精品| 欧美久久久久中文字幕| 中文幕一区二区三区久久蜜桃| 亚洲午夜私人影院| av影院午夜一区| 欧美大片免费久久精品三p| 一区二区三区在线免费视频| 麻豆成人91精品二区三区| 91国偷自产一区二区三区成为亚洲经典| 7777精品伊人久久久大香线蕉的| 中文字幕免费在线观看视频一区| 亚洲一区二区三区爽爽爽爽爽| 国产成人免费视频| 精品三级在线观看| 日韩精品亚洲专区| 欧美日韩免费在线视频| 综合欧美一区二区三区| 国产精品一区在线观看你懂的| 欧美久久一区二区| 亚洲成人综合视频| 欧美性欧美巨大黑白大战| 综合亚洲深深色噜噜狠狠网站| 国产一区二区女| 久久婷婷国产综合国色天香 | 成人午夜视频免费看| 精品1区2区在线观看| 美女精品自拍一二三四| 日韩亚洲欧美高清| 美女脱光内衣内裤视频久久网站| 色综合一个色综合| 亚洲一区二区在线观看视频| 色婷婷综合久久久中文字幕| 亚洲日韩欧美一区二区在线| 99久久精品国产观看| 最新热久久免费视频| 91小视频在线免费看| 亚洲欧美日韩中文播放| 欧美性色黄大片| 青青草伊人久久| 久久久精品tv| 成人免费高清在线观看| 亚洲欧美在线高清| 欧美日韩一区成人| 激情文学综合网| 中文字幕一区二区三区色视频| 色综合久久六月婷婷中文字幕| 亚洲国产另类精品专区| 这里只有精品99re| 国产成人啪午夜精品网站男同| 自拍偷在线精品自拍偷无码专区 | 亚洲裸体xxx| 在线成人免费视频| 粉嫩绯色av一区二区在线观看| 亚洲三级电影网站| 久久久午夜精品理论片中文字幕| 99久久伊人精品| 欧美aaa在线| 亚洲乱码精品一二三四区日韩在线| 91精品国产综合久久精品app| 国产老妇另类xxxxx| 激情亚洲综合在线| 国产欧美久久久精品影院| 精品亚洲成a人在线观看| 亚洲视频在线观看一区| 日韩欧美123| 欧美性高清videossexo| 成人午夜看片网址| 极品少妇xxxx精品少妇偷拍| 亚洲女性喷水在线观看一区| 久久精品人人做人人爽人人| 欧美日韩一区视频| 亚洲精品亚洲人成人网| 日韩欧美一级二级三级| 欧美影院精品一区| 欧美日韩久久久| 一本久久精品一区二区| 不卡的av电影|