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

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

?? smedia.c

?? Cirrus Logic EP7312處理器部分控制程序。
?? C
字號:
//****************************************************************************
//
// SMEDIA.C - Performs a non-destructive test on a SmartMedia card.
//
// Copyright (c) 1999 - 2001 Cirrus Logic, Inc.
//
//****************************************************************************
#include "lib7312.h"

//****************************************************************************
//
// ucBuffer is used to save the contents of a block of the SmartMedia card
// during the test.  This buffer is the maximum size of a block of a
// SmartMedia card.
//
//****************************************************************************
unsigned char ucBuffer[528 * 32];

//****************************************************************************
//
// PrintLong prints the value of a variable on the LCD in hexadecimal.
//
//****************************************************************************
void
PrintLong(unsigned long ulValue, long lX, long lY, CPixel sColor)
{
    char cMap[17] = "0123456789ABCDEF";

    //
    // Print out the value the way "%04X" would in C.
    //
    LCDColorPrintChar(cMap[(ulValue & 0xF000) >> 12], lX, lY, sColor);
    LCDColorPrintChar(cMap[(ulValue & 0x0F00) >> 8], lX + 8, lY, sColor);
    LCDColorPrintChar(cMap[(ulValue & 0x00F0) >> 4], lX + 16, lY, sColor);
    LCDColorPrintChar(cMap[ulValue & 0x000F], lX + 24, lY, sColor);
}

//****************************************************************************
//
// This program performs a non-destructive memory test on a SmartMedia card.
// The memory on the card is tested a block at a time, with the original
// contents of the block being restored after the block is tested.  This is
// not to be construed as an effective test of the NAND FLASH on the
// SmartMedia card, but more as a means of showing how to read and write data
// via the SmartMedia interface.
//
//****************************************************************************
void
entry(void)
{
    unsigned long ulSize, ulPageSize, ulPagesPerBlock, ulNumBlocks;
    unsigned long ulBlock, ulPattern, ulIdx, ulLoop, ulErrors = 0, ulBadBlock;
    unsigned char ucData[512 + 16];
    unsigned char ucPatterns[] = { 0x00, 0x55, 0xaa, 0xff };
    CPixel sWrite, sErase;
    char cTemp;

    //
    // Enable the LCD controller, clear the frame buffer, and turn on the LCD
    // panel.
    //
    LCDColorEnable();
    LCDColorCls();
    LCDColorOn();
    LCDColorBacklightOn();
    LCDColorContrastEnable();

    //
    // Set the Write color to white.
    // 
    sWrite.r = 15;
    sWrite.g = 15;
    sWrite.b = 15;

    //
    // Set the Erase color to black.
    //
    sErase.r = 0;
    sErase.g = 0;
    sErase.b = 0;

    //
    // Get the device geometry of the SmartMedia card.
    //
    if(!(SMGetSize(&ulSize, &ulPageSize, &ulPagesPerBlock, &ulNumBlocks)))
    {
          LCDColorPrintString("Error retrieving the Smart Media Size", 5, 20,
		  sWrite);
	  LCDColorPrintString("information.", 5, 30, sWrite);
          LCDColorPrintString("Smart Media card may not be inserted.", 5, 42, 
                               sWrite);
    }
    else
    {

       //
       // The page size returned is just the main storage area.  We want to save
       // and restore (and therefore test) the save area as well.  If we do not
       // preserve the save area, the SSFDC file system on the card will be
       // destroyed.
       //
       ulPageSize += ulPageSize / 32;

       //
       // Display the basic progress information.
       //
       LCDColorPrintString("Block:", 100, 70, sWrite);
       LCDColorPrintString("Failures:", 100, 80, sWrite);
       LCDColorPrintString("0000", 175, 80, sWrite);

       //
       // Test each block of the SmartMedia card a block at a time.
       //
       for(ulBlock = 0; ulBlock < ulNumBlocks; ulBlock++)
       {
          //
          // If we're not on the first block, erase the block 
          // number from the LCD.
          //
          if (ulBlock != 0)
	  {
             PrintLong(ulBlock - 1, 175, 70, sErase);
	  }
         
          //
          // Display this sector number on the LCD screen.
          //
          PrintLong(ulBlock, 175, 70, sWrite);

          //
          // Initially, this block is not bad.
          //
          ulBadBlock = 0;

          //
          // Read the contents of each page in this block.
          //
          for(ulIdx = 0; ulIdx < ulPagesPerBlock; ulIdx++)
          {
             SMReadPage((ulBlock * ulPagesPerBlock) + ulIdx, 1,
                         ucBuffer + (ulIdx * ulPageSize));
          }

          //
          // Test this block with our four bit patterns (all zeros, all ones, and
          // the two different checkboards).
          //
          for(ulPattern = 0; ulPattern < 4; ulPattern++)
          {
             //
             // Erase this block.
             //
             SMEraseBlock(ulBlock);

             //
             // Fill the data buffer with the current pattern.
             //
             for(ulIdx = 0; ulIdx < ulPageSize; ulIdx++)
             {
                ucData[ulIdx] = ucPatterns[ulPattern];
             }

             //
             // Write the data buffer to each page in this block.
             //
             for(ulIdx = 0; ulIdx < ulPagesPerBlock; ulIdx++)
             {
                SMWritePage((ulBlock * ulPagesPerBlock) + ulIdx, 1, ucData);
             }

             //
             // Read back each page of this block.
             //
             for(ulIdx = 0; ulIdx < ulPagesPerBlock; ulIdx++)
             {
                //
                // Read the page.
                //
                SMReadPage((ulBlock * ulPagesPerBlock) + ulIdx, 1, ucData);

                //
                // Check to see that each byte of the read back data matches
                // the pattern that we wrote.
                //
                for(ulLoop = 0; ulLoop < ulPageSize; ulLoop++)
                {
                    //
                    // Does this byte match?
                    //
                    if(ucData[ulLoop] != ucPatterns[ulPattern])
                    {
                        //
                        // One byte in this block is bad.
                        //
                        ulBadBlock = 1;
                    }
                }
             }
          }

          //
          // Erase this block.
          //
          SMEraseBlock(ulBlock);

          //
          // Now write a different pattern in each page of the block.
          //
          for(ulIdx = 0; ulIdx < ulPagesPerBlock; ulIdx++)
          {
             //
             // Create the data pattern in the buffer.
             //
             for(ulLoop = 0; ulLoop < ulPageSize; ulLoop = ulLoop + 4)
             {
                cTemp = (0x80 + ulIdx + ulLoop) & 0xff;
                ucData[ulLoop] = cTemp;
                ucData[ulLoop + 1] = cTemp;
                ucData[ulLoop + 2] = cTemp;
                ucData[ulLoop + 3] = cTemp;
             }

             //
             // Write the data pattern to this page.
             //
             SMWritePage((ulBlock * ulPagesPerBlock) + ulIdx, 1, ucData);
          }

          //
          // Read back the data for verification.
          //
          for(ulIdx = 0; ulIdx < ulPagesPerBlock; ulIdx++)
          {
             //
             // Read this page.
             //
             SMReadPage((ulBlock * ulPagesPerBlock) + ulIdx, 1, ucData);

             //
             // Verify that the data matches the pattern written.
             //
             for(ulLoop = 0; ulLoop < ulPageSize; ulLoop = ulLoop + 4)
             {
                //
                // Does this byte match?
                //
                cTemp = (0x80 + ulIdx + ulLoop) & 0xff;
                if(cTemp != (ucData[ulLoop] | ucData[ulLoop + 1] |
                             ucData[ulLoop + 2] | ucData[ulLoop + 3]))
                {
                    //
                    // One byte in this block is bad.
                    //
                    ulBadBlock = 1;
                }
             }
          }

          //
          // Erase this block.
          //
          SMEraseBlock(ulBlock);

          //
          // Restore the original contents of this block.
          //
          for(ulIdx = 0; ulIdx < ulPagesPerBlock; ulIdx++)
          {
             SMWritePage((ulBlock * ulPagesPerBlock) + ulIdx, 1,
                         ucBuffer + (ulIdx * ulPageSize));
          }

          //
          // If we found an error in this block, the increment the count of bad
          // blocks.
          //
          if(ulBadBlock)
          {
             ulErrors++;

             //
             // Print out the number of errors.
             //
             PrintLong(ulErrors - 1, 175, 80, sErase); 
             PrintLong(ulErrors, 175, 80, sWrite);
         }
      }
   }

   //
   // Ask the user to press a keyboard button.
   //
   LCDColorPrintString("The Smart Media test is completed.", 40, 100, sWrite);
   LCDColorPrintString("Press one of the User keys on the", 40, 115, sWrite);
   LCDColorPrintString("keypad to exit.", 40, 125, sWrite);

   //
   // Wait until a user button is pressed.
   //
   KPGetUserButton();
   KPNoButton();

   //
   // Turn off the LCD panel.
   //
   LCDColorOff();
   LCDColorBacklightOff();
   LCDColorOff();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区你懂的| 亚洲狠狠丁香婷婷综合久久久| 免费高清在线视频一区·| 67194成人在线观看| 日韩av一区二区在线影视| 91精品国产麻豆| 黄页视频在线91| 国产精品美日韩| 91免费看片在线观看| 一区二区三区.www| 日韩精品一区在线观看| 国产精品自在在线| 国产精品第四页| 精品视频一区 二区 三区| 美女视频一区二区三区| 久久你懂得1024| 91亚洲男人天堂| 免费在线一区观看| 欧美激情一区在线| 欧美精品乱人伦久久久久久| 九色综合国产一区二区三区| 亚洲欧洲av在线| 欧美一区二区大片| 懂色av一区二区在线播放| 91精品麻豆日日躁夜夜躁| 亚洲电影一区二区三区| 日韩西西人体444www| 国产精品一区二区三区乱码| 亚洲精品欧美二区三区中文字幕| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲视频小说图片| 欧美性猛交xxxx乱大交退制版 | 午夜精品成人在线| 国产欧美日韩视频在线观看| 欧美日韩一级片在线观看| 国产成人欧美日韩在线电影| 亚洲chinese男男1069| 国产亚洲欧美一区在线观看| 欧美日韩久久不卡| www.亚洲在线| 久久er精品视频| 亚洲国产精品一区二区尤物区| 国产亚洲精品7777| 欧美狂野另类xxxxoooo| 波多野结衣在线一区| 久久精品99国产精品日本| 一区二区三区精品久久久| 久久精品网站免费观看| 欧美顶级少妇做爰| 91影院在线免费观看| 国产一区二区久久| 蜜桃91丨九色丨蝌蚪91桃色| 一区二区三区四区中文字幕| 国产亚洲精品久| 欧美一区二区三级| 欧美亚洲一区三区| 99久久精品免费| 国产精品99久| 国精品**一区二区三区在线蜜桃| 亚洲一卡二卡三卡四卡五卡| 国产精品夫妻自拍| 国产精品视频线看| 久久伊99综合婷婷久久伊| 欧美一区二区免费视频| 欧美日韩在线三级| 欧美性受极品xxxx喷水| 一本色道亚洲精品aⅴ| av爱爱亚洲一区| eeuss鲁片一区二区三区| 成人一区在线看| 国产高清精品久久久久| 国产一区二区精品在线观看| 精品一区二区免费在线观看| 青青草原综合久久大伊人精品| 亚洲图片欧美色图| 亚洲一二三区在线观看| 夜色激情一区二区| 亚洲综合色在线| 亚洲电影激情视频网站| 亚洲成a人在线观看| 亚洲综合成人在线| 亚洲自拍偷拍欧美| 亚洲电影视频在线| 视频一区二区三区入口| 丝袜美腿高跟呻吟高潮一区| 婷婷综合久久一区二区三区| 亚洲成人中文在线| 日本不卡一区二区三区| 美女看a上一区| 国产资源精品在线观看| 高清国产午夜精品久久久久久| av网站免费线看精品| 日本大香伊一区二区三区| 欧美日韩国产一区二区三区地区| 欧美一级二级三级乱码| 久久影院午夜片一区| 国产精品久久精品日日| 亚洲综合在线第一页| 男女男精品视频| 国产成人无遮挡在线视频| 91视频在线观看免费| 欧美日韩亚洲国产综合| 日韩精品一区二区三区swag| 国产精品入口麻豆九色| 亚洲日本一区二区| 日韩中文字幕一区二区三区| 精品一区二区国语对白| 91啪亚洲精品| 91.com视频| 国产精品福利一区| 亚洲va欧美va国产va天堂影院| 精品一区二区三区欧美| 色狠狠一区二区三区香蕉| 日韩视频免费直播| 国产精品白丝在线| 日韩激情一区二区| jvid福利写真一区二区三区| 91精品欧美久久久久久动漫| 国产女人18水真多18精品一级做| 亚洲美女免费视频| 极品尤物av久久免费看| 91啪在线观看| 久久精品视频网| 亚洲成a天堂v人片| 99精品视频中文字幕| 欧美xxxxx牲另类人与| 亚洲人妖av一区二区| 麻豆91精品视频| 欧美性猛交xxxx乱大交退制版| 久久久久久久免费视频了| 亚洲国产精品久久久久秋霞影院| 激情文学综合网| 91 com成人网| 夜夜精品视频一区二区| 成人黄色在线网站| 欧美成人三级在线| 亚洲国产一二三| 91美女在线观看| www成人在线观看| 奇米影视一区二区三区| 在线日韩一区二区| 中文字幕中文字幕中文字幕亚洲无线 | 国产一区二区精品久久91| 欧美电影在线免费观看| 亚洲精品菠萝久久久久久久| 国产999精品久久| 香蕉久久夜色精品国产使用方法| 国产91色综合久久免费分享| 3751色影院一区二区三区| 亚洲成人免费在线| 91黄色免费网站| 亚洲欧美日韩国产手机在线 | 欧美日韩中文一区| 一区在线观看免费| 丁香婷婷深情五月亚洲| 精品美女被调教视频大全网站| 日韩精品久久久久久| 欧美日韩中字一区| 一区二区三区不卡视频在线观看| 91麻豆文化传媒在线观看| 国产精品毛片久久久久久久| 国产成人精品免费网站| 久久久精品中文字幕麻豆发布| 精品一区二区久久久| 精品国产一区二区三区av性色 | 欧美国产1区2区| 成人性生交大片免费看在线播放| 精品1区2区在线观看| 精品无码三级在线观看视频| 精品卡一卡二卡三卡四在线| 狠狠色综合播放一区二区| 久久亚洲欧美国产精品乐播| 狠狠色2019综合网| 欧美极品少妇xxxxⅹ高跟鞋| caoporen国产精品视频| 亚洲视频1区2区| 欧美网站大全在线观看| 日韩在线一二三区| 欧美岛国在线观看| 国产v综合v亚洲欧| 亚洲人成网站影音先锋播放| 91国产免费看| 日本在线不卡一区| 久久综合九色欧美综合狠狠| 成人午夜av影视| 一区二区三区高清在线| 777亚洲妇女| 国产成人精品免费视频网站| 亚洲欧美综合在线精品| 国产成人av资源| 91视视频在线观看入口直接观看www| 亚洲精品视频一区| 91精品国产综合久久香蕉的特点 | 欧美日本乱大交xxxxx| 久久精品国产亚洲aⅴ| 国产日产欧产精品推荐色| 9i在线看片成人免费| 亚洲一级二级三级| 欧美精品一区二区蜜臀亚洲| 不卡av在线免费观看|