Jpg.c
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:30k
源码类别:

压缩解压

开发平台:

C++ Builder

  1. /*==========================================================================
  2. Copyright (c) 2004 ALi Corporation. All Rights Reserved
  3. File: Jpg.c
  4. content:
  5. History: Created by Walace 2005/01/12
  6. ==========================================================================*/
  7. #define _JPG_H_
  8. #include <DP8051XP.H>
  9. #include "TypeDef.h"
  10. #include "Const.h"
  11. #include "Reg5661.h"
  12. #include "Common.h"
  13. #include "OledString.h"
  14. #include "Key.h"
  15. #include "Idma.h"
  16. #include "FileSystem.h"
  17. #include "IconDefine.h"
  18. #include "OLED.h"
  19. #include "UiCommon.h"
  20. #if(PHOTO_BMP_DSP_DECODE)
  21. #include "Bmp.h"
  22. #endif
  23. #if(PHOTO_SUPPORT_JPG)
  24. #include "Jpg.h"
  25. #include "UiPhoView.h"
  26. #include "VideoDsp.h"  //Walace060309#3
  27. //3 ================================
  28. #define DSP_BLOCK_SIZE 256
  29. //3==== JPGGetImageFromDsp =========
  30. #define IMG_PRC_ERR            0x00
  31. #define IMG_PRC_NOP            0x00
  32. #define IMG_PRC_SUCCESS    0x01
  33. #define IMG_PRC_COMPLETE  0x02
  34. //3 == Dsp command ===============
  35. #define DSP_REQ_START      0x01
  36. #define DSP_REQ_END      0x02
  37. //3 ==== gxbJpgProcState ============
  38. #define JPG_PRC_IDLE 0x00
  39. #define JPG_PRC_INITIAL 0x01
  40. #define JPG_PRC_DATA_TO_DSP 0x02
  41. #define JPG_PRC_GET_FROM_DSP 0x03
  42. #define JPG_PRC_SHOW 0x04
  43. #define JPG_PRC_ERR 0x05
  44. #define JPG_PRC_END 0x06
  45. #define DSP_JPG_COLOR_CODE_RGB   0
  46. #define DSP_JPG_COLOR_CODE_BGR 1
  47. #define DSP_JPG_START_FLAG       0x0000 
  48. //Walace051214#FullScreen
  49. #define DSP_JPG_NO_SHRINK_FLAG      0x1FF0   // 0:Dsp shrink 1:Dsp no shrink
  50. #define DSP_JPG_PHOTO_WIDTH  0x1FF1    //The real pixel number of one row
  51. #define DSP_JPG_PHOTO_HEIGHT 0x1FF2   //The real pixel number of one column
  52. #define DSP_JPG_WIDTH_SIZE       0x1FF3  // set lcd width size
  53. #define DSP_JPG_HEIGHT_SIZE      0x1FF4  // set lcd height size
  54. #define DSP_JPG_LCD_TYPE           0x1FF5  // 0:STN 1:OLED
  55. #define DSP_JPG_ERR_MSG 0x1FF6  // 0:No error 1:format not support
  56. #define JPEG_DSP_NO_ERR 0x00 //Walace060816#4
  57. #define JPEG_FORMAT_NOT_SUPPORT 0x01 //Walace060816#4
  58. #define DSP_JPG_INPUT_ADDR     0x1FF7  // Dsp inbuffer address
  59. #define DSP_JPG_INPUT_FLAG       0x1FF8  // 1:FW write 512 bytes to DSP  2: FW write complete
  60. #define DSP_JPG_OUTPUT_ADDR    0x1FF9  // Dsp outbuffer address
  61. #define DSP_JPG_OUTPUT_FLAG    0x1FFA  // 1:FW could get 512 bytes form dsp 2: get data complete
  62. #define DSP_JPG_DEC_FINISH        0x1FFB  // 0: image decode not finish 1:image decode finish
  63. #define DSP_JPG_BLOCK_WIDTH 0x1FFC  // MCU width
  64. #define DSP_JPG_BLOCK_HEIGHT 0x1FFD  // MCU Height
  65. #define DSP_JPG_BLOCK_COLS        0x1FFE  // Image total coloumns
  66. #define DSP_JPG_BLOCK_PAGES 0x1FFF  // Image total pages
  67. XBYTE gxbJpgProcState = JPG_PRC_IDLE;
  68. //Walace061018#2 bmp dsp decode  start
  69. BOOL JpgShow(void);
  70. #if(PHOTO_BMP_DSP_DECODE)
  71. BOOL BmpShow(void);
  72. #endif
  73. #if(DSP_BMP_DEBUG)
  74. void BmpDspDebug(void);
  75. #endif
  76. //Walace061018#2 bmp dsp decode end
  77. //Walace051214#FullScreen move to UiPhotoView.h
  78. /*
  79. BOOL gfGetPhoConfig;
  80. //3 == Photo process parameters =================
  81. //XDWORD gxdwBlockTotalNum; //Walace051202#2
  82. XWORD gxwMcuSize;
  83. XWORD gxwBlockHeight;
  84. XWORD gxwBlockWidth;
  85. XWORD gxwBlockColNum;
  86. XWORD gxwBlockPageNum;
  87. XDWORD gxdwCurrentBlockNum; //Walace051202#2 word->dword
  88. */
  89. //3==============================================================
  90. void JpgSetMonitorSizeTypeToDsp(BYTE bWidth,BYTE bHeight,BYTE bLcdType) 
  91. {
  92. WORD wDspVal;
  93. wDspVal = (WORD)bWidth;
  94. IdmaPioDmxW(&wDspVal, DSP_JPG_WIDTH_SIZE, 1, DSP_W16); //Set finish data transfer
  95. wDspVal = (WORD)bHeight;
  96. IdmaPioDmxW(&wDspVal, DSP_JPG_HEIGHT_SIZE, 1, DSP_W16); //Set finish data transfer
  97. wDspVal = (WORD)bLcdType;
  98. IdmaPioDmxW(&wDspVal, DSP_JPG_LCD_TYPE, 1, DSP_W16);  //Walace051115#1
  99. wDspVal = (WORD)FALSE; // shrink  //Walace051212#FullScreen
  100. //wDspVal = (WORD)TRUE; // no shrink    //Walace051212#FullScreen
  101.        IdmaPioDmxW(&wDspVal, DSP_JPG_NO_SHRINK_FLAG,1,DSP_W16);
  102. }
  103. BYTE CheckImageIn(void) large
  104. {
  105. WORD wDspVal;
  106. IdmaPioDmxR(DSP_JPG_INPUT_FLAG, &wDspVal, 1,DSP_W16);
  107. return (BYTE)wDspVal;
  108. }
  109. //==============================================================
  110. BYTE CheckImageOut(void) large
  111. {
  112. WORD wDspVal;
  113. IdmaPioDmxR(DSP_JPG_OUTPUT_FLAG, &wDspVal, 1,DSP_W16);
  114. return (BYTE)wDspVal;
  115. }
  116. //==============================================================
  117. BOOL JpgFillDataToDsp(void) 
  118. {
  119.    WORD wDspVal;
  120.    
  121.    //2  fill sram buffer from file with 512 bytes
  122.    // gdwFileSectory : current sector number send to dsp
  123.    if(gdwFileSector<(stPhoFileInf.dwFileTotalSector))
  124.    {
  125.        if(CheckImageIn()!=DSP_REQ_START) //check dsp request data
  126.         return TRUE;
  127.     if(FsReadFileSectorNew(gdwFileSector++,FS_DATA_0_0)) //read a sector
  128.     {
  129.     
  130. IdmaPioDmxR(DSP_JPG_INPUT_ADDR,&wDspVal,1,DSP_W16); //get DSP write index
  131. //Send 512 bytes to DSP
  132. obRACTL |= RA_INIT;
  133. obSOURCEPATHCTRL &= 0xef; //source buffer disable
  134. obTARGETPATHCTRL &= 0xef;    //target buffer disable
  135. obRACTL &= RA_NORMAL_J;
  136. obRACTL |= RA_COPY_MODE_EN;
  137. obRAINIADRL = (SRAM_DATA_ADDR+gxwOffsetDataSec) & 0xFF; //set RA sddress
  138. obRAINIADRH = (((SRAM_DATA_ADDR+gxwOffsetDataSec) >> 8) & 0x1F);
  139. obRAINIADRH |= 0x80;
  140. obTARGETPATHCTRL=0x36; //set Target IDMA, buffer EN
  141. IdmaDmxW(wDspVal,256,DSP_W16); //IDMA from SRAM to DSP
  142. obRACTL |= 0x80; //DMA EN 
  143.        while(obIDMAREQ)  //polling IDMA request inactive
  144. {;}
  145. obRACTL &= 0x7F; //DMA Dis
  146. obRACTL &= RA_COPY_MODE_DIS;
  147. wDspVal=DSP_REQ_END;
  148. IdmaPioDmxW(&wDspVal, DSP_JPG_INPUT_FLAG, 1, DSP_W16); //Set finish data transfer
  149. return TRUE;
  150.     }
  151.       else
  152.       { 
  153.         // Warring! this retun value must be return with FALSE,but now return TRUE for the bug of DSP
  154.           // return TRUE;     //Walace060816#4
  155.              return FALSE;
  156.         }
  157.     }
  158.     return TRUE;
  159. }
  160. //==============================================================
  161. BOOL JpgGetConfig(void)  //Walace051202#4
  162. {
  163.     //WORD wDspVal; //Walace051202#4
  164.     IdmaPioDmxR(DSP_JPG_BLOCK_PAGES, &gxwBlockPageNum, 1,DSP_W16);
  165.     IdmaPioDmxR(DSP_JPG_BLOCK_COLS, &gxwBlockColNum, 1,DSP_W16);
  166.     IdmaPioDmxR(DSP_JPG_BLOCK_WIDTH, &gxwBlockWidth, 1,DSP_W16);
  167.     IdmaPioDmxR(DSP_JPG_BLOCK_HEIGHT, &gxwBlockHeight, 1,DSP_W16);
  168.     IdmaPioDmxR(DSP_JPG_PHOTO_WIDTH, &gxwPhoWidth, 1,DSP_W16);
  169.     IdmaPioDmxR(DSP_JPG_PHOTO_HEIGHT, &gxwPhoHeight, 1,DSP_W16);
  170. /* //Walace051202#4
  171. IdmaPioDmxR(DSP_JPG_ERR_MSG,&wDspVal,1,DSP_W16);
  172. if(wDspVal!=JPEG_DSP_NO_ERR)
  173. {
  174. gxbErrCode = ERR_PE_UNSUPPORT_FORMAT;
  175. return FALSE;
  176. }
  177. */
  178.  //   gxdwBlockTotalNum =gxwBlockPageNum*gxwBlockColNum; //Walace051202#2
  179.     gxwMcuSize = gxwBlockWidth * gxwBlockHeight;
  180.   //  OledShowNumber(gxwPhoWidth,WORD0,LINE0,6);
  181.  //   OledShowNumber(gxwPhoHeight,WORD0,LINE1,6);
  182.     GetPhoCommonConfig();
  183. /*
  184.     OledShowNumber(gxwPhoWidth,WORD0,PAGE0,6);
  185.     OledShowNumber(gxwPhoHeight,WORD0,PAGE1,6);
  186.     OledShowNumber(gxwBlockColNum,WORD0,PAGE2,6);
  187.     OledShowNumber(gxwBlockPageNum,WORD0,PAGE3,6);
  188.     OledShowNumber(gxwBlockWidth,WORD0,PAGE4,6);
  189.     OledShowNumber(gxwBlockHeight,WORD0,PAGE5,6);
  190.     OledShowNumber(gxwPhotoDispWidth,WORD0,PAGE6,6);
  191.     OledShowNumber(gxwPhotoDispHeight,WORD0,PAGE7,6);
  192.     OledShowNumber(gxwSampleSize,WORD3,PAGE0,6);
  193.     OledShowNumber(gxbfRotPhoto,WORD3,PAGE1,6);
  194.     */
  195. /*
  196.     OledShowNumber(gxwBlockColNum,WORD3,PAGE2,6);
  197.     OledShowNumber(gxwBlockPageNum,WORD3,PAGE3,6);
  198.     OledShowNumber(gxwBlockWidth,WORD3,PAGE4,6);
  199.     OledShowNumber(gxwBlockHeight,WORD3,PAGE5,6);
  200.     OledShowNumber(gxwPhotoDispWidth,WORD3,PAGE6,6);
  201.     OledShowNumber(gxwPhotoDispHeight,WORD3,PAGE7,6);
  202.     
  203.     gxbLcdCounter=0;
  204.     while(1)
  205.      {}
  206. */
  207. return TRUE; //Walace051202#4
  208. }
  209. //Walace061018#2 bmp dsp decode
  210. #if(PHOTO_BMP_DSP_DECODE)
  211. BOOL BmpGetConfig(void)
  212. {
  213. IdmaPioDmxR(DSP_JPG_PHOTO_WIDTH, &gxwPhoWidth, 1,DSP_W16);
  214. IdmaPioDmxR(DSP_JPG_PHOTO_HEIGHT, &gxwPhoHeight, 1,DSP_W16);
  215. gxbfRotPhoto=FALSE; //Walace070108#2
  216. #if(UI_PHOTO_DISP_SIZE_COL>UI_PHOTO_DISP_SIZE_ROW)
  217. gxbfRotPhoto =      (gxwPhoWidth<gxwPhoHeight) //Walace070108#2
  218.                 && ((gxwPhoWidth>UI_PHOTO_DISP_SIZE_COL)||(gxwPhoHeight>UI_PHOTO_DISP_SIZE_ROW));
  219. #else
  220. gxbfRotPhoto =     (gxwPhoWidth>gxwPhoHeight) //Walace070108#2
  221.                 && ((gxwPhoWidth>UI_PHOTO_DISP_SIZE_COL)||(gxwPhoHeight>UI_PHOTO_DISP_SIZE_ROW));
  222. #endif
  223. gxwXPixel = 0;
  224. gxwYPixel = gxwPhoHeight-1;
  225. return TRUE;
  226. }
  227. #endif
  228. //--------------------------------------------------------------------------------
  229. //Walace060816#4 
  230. #define GET_JPEG_DATA_NONE 0x00 
  231. #define GET_JPEG_DATA_DONE 0x01
  232. #define GET_JPEG_CONFIG_ERR 0x02
  233. BYTE  JpgGetImageFromDsp()  //Walace060816#4
  234. {
  235.    //2 Get image data from dsp 512 bytes to Sram
  236.        WORD wDspVal;
  237.        WORD SramAddr=SRAM_PHOTO_DATA_START;
  238.    
  239. if(CheckImageOut()==DSP_REQ_START) //DSP request send out a sector
  240. {
  241. GPIOA_ON(5);
  242. if (!gfGetPhoConfig)  // browse image at firt times need to get required parameter
  243. {
  244. //Walace061018#2 bmp dsp decode start
  245. #if(PHOTO_BMP_DSP_DECODE)
  246. switch(gxbPhotoType)
  247. {   
  248. case PHO_TYPE_JPG:
  249.                       if(!JpgGetConfig())  //Walace060816#4
  250. return GET_JPEG_CONFIG_ERR;  
  251.     break;
  252. case PHO_TYPE_BMP:
  253.           if(!BmpGetConfig())
  254. return GET_JPEG_CONFIG_ERR;  
  255. break;
  256. }
  257. #else
  258.                      if(!JpgGetConfig())  //Walace060816#4
  259. return GET_JPEG_CONFIG_ERR;  
  260. #endif
  261. //Walace061018#2 bmp dsp decode end
  262.    
  263.       gfGetPhoConfig=TRUE;
  264. }
  265.               // get image output address
  266. IdmaPioDmxR(DSP_JPG_OUTPUT_ADDR,&wDspVal,1,DSP_W16);
  267. //Get 512 bytes from DSP
  268. obRACTL = RA_INIT;
  269. //obSOURCEPATHCTRL &= 0xef; //source buffer disable
  270. //obTARGETPATHCTRL &= 0xef;       //target buffer disable
  271. obRACTL &= RA_NORMAL_J;
  272. obRAINIADRL = SRAM_DMA_ADDRESS & 0xFF; //set RA address
  273. obRAINIADRH = ((SRAM_DMA_ADDRESS >> 8) & 0x1F);
  274. obRAINIADRH |= 0x80;
  275. obRABANKSIZEL=0x00; //Set RA size 512B
  276. obRABANKSIZEH=0x02;
  277. obMODSEL3 &= NOTBYPASS_RAJ;  //allen050601: force NotBypassRa 
  278. obSOURCEPATHCTRL=0x36; //set Source IDMA, buffer EN
  279. obTARGETPATHCTRL=0x37; //Target SRAM
  280. obDOWNLOADADDRL=(SramAddr>>3)&0xFF; //SRAM Address
  281. obDOWNLOADADDRH=(SramAddr>>11)&0x3f;
  282. obDOWNLOADADDRH |= 0xc0;//to sram, reload address
  283. obDOWNLOADADDRH&=0xBF; //normal
  284. // obTARGETPATHCTRL=0x37; //set Target RA, buffer EN
  285. IdmaDmxR(wDspVal,256); //IDMA from DSP to SRAM
  286. obRACTL |= 0x80; //DMA EN 
  287. while(obIDMAREQ)  //polling IDMA request inactive
  288. {;}
  289. obRACTL |= 0x10; //DMA SEND
  290. while(!(obRASTATUS & 0x80))
  291. {;}
  292. obRACTL &= 0x7F; //DMA Dis
  293. obIDMACTRL&=IDMA_ACT_DIS;
  294. wDspVal=DSP_REQ_END;
  295. IdmaPioDmxW(&wDspVal, DSP_JPG_OUTPUT_FLAG, 1,DSP_W16); //Set finish data transfer  
  296. GPIOA_OFF(5);
  297. return GET_JPEG_DATA_DONE; //Walace060816#4 start
  298. }
  299.    return GET_JPEG_DATA_NONE;   //Walace060816#4 start
  300. }
  301. //==============================================================
  302. //Walace061018#2 bmp dsp decode
  303. BOOL JpgBmpShow(void)
  304. {
  305. switch(gxbPhotoType)
  306. {   
  307. case PHO_TYPE_JPG:
  308.           return JpgShow();
  309. #if(PHOTO_BMP_DSP_DECODE)
  310. case PHO_TYPE_BMP:
  311.           return BmpShow();
  312. #endif
  313. }
  314. }
  315. //Walace051212#FullScreen
  316. BOOL JpgShow(void) 
  317. {
  318.    //2 2 Send Sram data to OLED
  319.    WORD McuNum;
  320.    WORD wBi,wXi,wYi;
  321.    WORD wCol,wRow;
  322.    PWORD pwData;
  323.    pwData=(PWORD)gxbPhoData;
  324.    
  325.    McuNum=DSP_BLOCK_SIZE/gxwMcuSize;
  326.    OledCtrlEn();
  327.    
  328.    #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY||LCD_TYPE==TFT_SOLOMON)   // Jeff070125#2
  329.    LCD_ROT90_DISPLAY_EN();
  330.    #endif
  331.    for(wBi=0;wBi<McuNum;wBi++)
  332.    {
  333.     if((gxdwCurrentBlockNum%gxwBlockColNum)==0)
  334.     {
  335.     gxwXStart=0;
  336. gxwXStep=0;
  337. gxwYStart=gxwYPixel;
  338. gxwYStepStart = gxwYStep;
  339.     }
  340. else
  341. {
  342. gxwYStep = gxwYStepStart;
  343. }
  344.        gxwXStepStart=gxwXStep;
  345.    
  346. gxwYPixel = gxwYStart;
  347.        for(wYi=0;wYi<gxwBlockHeight;wYi++)
  348.        {
  349. gxwYStep+=gxwSampleSize;
  350. if(!(gxwYStep&0x8000))
  351. {
  352. pwData+=gxwBlockWidth;
  353. continue;
  354. }
  355.               gxwYPixel++;
  356. gxwYStep&=(~0x8000);
  357. gxwXPixel = gxwXStart;
  358. gxwXStep=gxwXStepStart;
  359.         for(wXi=0;wXi<gxwBlockWidth;wXi++)
  360.         {
  361. gxwXStep+=gxwSampleSize;
  362.                      
  363.  
  364. if(!(gxwXStep&0x8000))
  365. {
  366. pwData++;
  367. continue;
  368. }
  369. gxwXPixel++;
  370. gxwXStep&=(~0x8000);
  371. //if((gxwXPixel<=gxwPhoWidth)&&(gxwYPixel<=gxwPhoHeight))   //Walace060320#1  //Walace060713#1 
  372. if((gxwXPixel<=gxwPhotoDispWidth)&&(gxwYPixel<=gxwPhotoDispHeight))   
  373. {
  374. //Walace060713#1 start
  375. //wCol=gxwXPixel; 
  376. //wRow=gxwYPixel;
  377. wCol=gxwXPixel-1;
  378. wRow=gxwYPixel-1;
  379. //Walace060713#1 end
  380.       if(gxbfRotPhoto) //Walace070108#2
  381.    RotToCenter(gxwPhotoDispWidth,gxwPhotoDispHeight,&wCol,&wRow);
  382.       else //if(gxwSampleSize<0x8000) //Walace060725#2
  383.    MoveToCenter(gxwPhotoDispWidth,gxwPhotoDispHeight,&wCol,&wRow);
  384. //if((wCol<OLED_MAX_COL)&&(wRow<OLED_MAX_ROW)) //Walace060320#3 //Walace060713#1
  385. if((wCol<UI_PHOTO_DISP_SIZE_COL)&&(wRow<UI_PHOTO_DISP_SIZE_ROW)) //Walace070103#2
  386. {
  387.  #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY)   // Jeff070125#2
  388. TftSetWindow(wCol,wRow,1,1);
  389. TFT_MEMORY_WRITE_START();
  390. OLED_WRITE(*((PBYTE)(pwData)+1)) ;
  391. OLED_WRITE(*((PBYTE)pwData)) ; 
  392.  #elif(LCD_TYPE==TFT_SOLOMON) //Jim#TftSolomn
  393. TftSetWindow(wRow,UI_PHOTO_DISP_SIZE_COL-wCol-1,1,1);
  394. TFT_MEMORY_WRITE_START();
  395. LCD_WRITE(*((PBYTE)(pwData)+1)) ;
  396. LCD_WRITE(*((PBYTE)pwData)) ; 
  397.  #else
  398. OLED_WRITE(OLED_CMD_SET_COL_ADDR) ;
  399. OLED_WRITE(wCol);
  400. OLED_WRITE(wCol);
  401. OLED_WRITE(OLED_CMD_SET_ROW_ADDR) ;
  402. OLED_WRITE(wRow);
  403. OLED_WRITE(wRow);
  404. OLED_SET_DAT();
  405.               #if(OLED_COLOR_FIELD_TYPE==OLED_FIELD_BGR565)
  406. OLED_WRITE(*((PBYTE)pwData)) ; 
  407. OLED_WRITE(*((PBYTE)(pwData)+1)) ;
  408. #else
  409. OLED_WRITE(*((PBYTE)(pwData)+1)) ;
  410. OLED_WRITE(*((PBYTE)pwData)) ;    
  411. #endif
  412. OLED_SET_CMD();
  413. #endif
  414. }
  415.  }
  416.  pwData++;
  417.         }
  418.        }
  419. // CommonDelay(0xFFFF);
  420. // CommonDelay(0xFFFF);
  421.    
  422. gxwXStart = gxwXPixel;
  423. gxwXStepStart = gxwXStep;
  424.        gxdwCurrentBlockNum++;  
  425.    
  426.   ////Walace051202#2 
  427. //if(gxwCurrentBlockNum>=gxwBlockTotalNum))    
  428.        if(gxdwCurrentBlockNum>=((DWORD)gxwBlockPageNum*gxwBlockColNum))  
  429.        {
  430. #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY||LCD_TYPE==TFT_SOLOMON) //Walace061020#1  // Jeff070125#2
  431. LCD_ROT90_DISPLAY_DIS();
  432. #endif     
  433.           OledCtrlDis();
  434.       return TRUE;
  435.        }
  436.    }
  437. #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY||LCD_TYPE==TFT_SOLOMON) //Walace061020#1  // Jeff070125#2
  438. LCD_ROT90_DISPLAY_DIS();
  439. #endif       
  440.    OledCtrlDis();   
  441.    return FALSE; 
  442.   
  443. }
  444. //Walace061018#2 bmp dsp decode start
  445. #if(PHOTO_BMP_DSP_DECODE)
  446. BOOL BmpShow(void)
  447. {
  448. WORD wBi;
  449. WORD wCol,wRow;
  450. PWORD pwData;
  451.   
  452. pwData=(PWORD)gxbPhoData;
  453. OledCtrlEn();
  454. #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY||LCD_TYPE==TFT_SOLOMON)  // Jeff070125#2
  455. LCD_ROT90_DISPLAY_EN();
  456. #endif
  457. //GPIOA_ON(6); //Walace070117#6 remove
  458. for(wBi=0;wBi<DSP_BLOCK_SIZE;wBi++)
  459. {
  460. wCol=gxwXPixel;
  461. wRow=gxwYPixel;
  462.       if(gxbfRotPhoto) //Walace070108#2
  463.    RotToCenter(gxwPhoWidth,gxwPhoHeight,&wCol,&wRow);
  464.       else
  465.    MoveToCenter(gxwPhoWidth,gxwPhoHeight,&wCol,&wRow);
  466. //if((wCol<OLED_MAX_COL)&&(wRow<OLED_MAX_ROW)) //Walace060320#3 //Walace060713#1 
  467. if((wCol<UI_PHOTO_DISP_SIZE_COL)&&(wRow<UI_PHOTO_DISP_SIZE_ROW)) //Walace070103#2
  468. {
  469.  #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY||LCD_TYPE==TFT_SOLOMON)  // Jeff070125#2
  470. TftSetWindow(wCol,wRow,1,1);
  471. TFT_MEMORY_WRITE_START();
  472. OLED_WRITE(*((PBYTE)(pwData)+1)) ;
  473. OLED_WRITE(*((PBYTE)pwData)) ; 
  474.  #else
  475. OLED_WRITE(OLED_CMD_SET_COL_ADDR) ;
  476. OLED_WRITE(wCol);
  477. OLED_WRITE(wCol);
  478. OLED_WRITE(OLED_CMD_SET_ROW_ADDR) ;
  479. OLED_WRITE(wRow);
  480. OLED_WRITE(wRow);
  481. OLED_SET_DAT();
  482.               #if(OLED_COLOR_FIELD_TYPE==OLED_FIELD_BGR565)
  483. OLED_WRITE(*((PBYTE)pwData)) ; 
  484. OLED_WRITE(*((PBYTE)(pwData)+1)) ;
  485. #else
  486. OLED_WRITE(*((PBYTE)(pwData)+1)) ;
  487. OLED_WRITE(*((PBYTE)pwData)) ;    
  488. #endif
  489. OLED_SET_CMD();
  490. #endif
  491. }
  492. pwData++;
  493. gxwXPixel++;
  494. if(gxwXPixel>=gxwPhoWidth)
  495. {
  496. if(gxwYPixel==0)
  497. {
  498. #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY||LCD_TYPE==TFT_SOLOMON)  // Jeff070125#2
  499. LCD_ROT90_DISPLAY_DIS();
  500. #endif
  501. GPIOA_OFF(6);
  502. OledCtrlDis();
  503. return TRUE;
  504. }
  505. gxwXPixel=0;
  506. gxwYPixel--;
  507. }
  508. }
  509. #if(LCD_TYPE==TFT_ORISE||LCD_TYPE==TFT_TOPPOLY||LCD_TYPE==TFT_SOLOMON)  // Jeff070125#2
  510. LCD_ROT90_DISPLAY_DIS();
  511. #endif
  512. //GPIOA_OFF(6); //Walace070117#6 remove
  513. OledCtrlDis();
  514. return FALSE;
  515. }
  516. #endif
  517. //Walace061018#2 bmp dsp decode end
  518. //==============================================================
  519. /* //Walace060309#3
  520. void SetDspStart(void) 
  521. {
  522.        BYTE cbDspSt[3]={0x18,0x03,0x0f};
  523. IdmaPioPmW(cbDspSt, 0, 1);
  524. }
  525. */
  526. //==============================================================
  527. //Walace060309#3
  528. void JpegDspInit(void) 
  529. {
  530. IDMA_READY_EN();
  531. DSP_CLK_SET_49();  //Walace060804#2
  532. DSP_RESET();
  533. DSP_ENABLE();
  534. }
  535. //Walace060309#3
  536. BOOL DownloadJpegDsp(void) 
  537. {
  538. //WORD wDspPmIdx,wDspDmxIdx,wDspDmy1Idx;
  539. WORD wDmyStrAddr;
  540. WORD wProgAddr;
  541. BYTE bProgLen;
  542. DSP_RESET();  //Walace060309#3
  543. DSP_ENABLE();
  544. DSP_PM_SIZE(DSP_PM_16BIT|DSP_PM_SIZE_6K); //set pm size 6k 24bit mode
  545. DSP_DMX_SIZE(DSP_DMX_24B_8K|DSP_DMX_16B_5K);
  546. DSP_DMY_SIZE(DSP_DMY_24B_4K|DSP_DMY_16B_6K);
  547. wDmyStrAddr=0x2000;
  548. //SET_DSP_16_MODE();
  549. /* //Walace060309#3
  550.        switch(bPhotoType)
  551.        {
  552.           case PHO_TYPE_JPG:
  553.    wDspPmIdx=PM_DSP_JPG_PM;
  554. wDspDmxIdx=PM_DSP_JPG_DMX;
  555. wDspDmy1Idx=PM_DSP_JPG_DMY;
  556.    break;
  557.           default:
  558.    return FALSE;
  559.    break;
  560.        }
  561. */
  562. if(NandReadPhySec(gxwAddrPMI,1,SRAM_DATA_ADDR)) //Download PM
  563. {
  564. wProgAddr=(((WORD)gxbFsData[PM_DSP_JPG_PM+1])<<8)|gxbFsData[PM_DSP_JPG_PM];
  565. bProgLen=gxbFsData[PM_DSP_JPG_PM+2];
  566. IdmaPmW(1,((((DWORD)bProgLen)<<9)/3)-1); //set idma and change length from sector to PM word(24bit)
  567. if(!NandReadPhySec(wProgAddr,bProgLen,0xFFFF))
  568. goto Err_Dsp_Download;
  569. }
  570. if(NandReadPhySec(gxwAddrPMI,1,SRAM_DATA_ADDR)) //Download DMX
  571. {
  572. wProgAddr=(((WORD)gxbFsData[PM_DSP_JPG_DMX+1])<<8)|gxbFsData[PM_DSP_JPG_DMX];
  573. bProgLen=gxbFsData[PM_DSP_JPG_DMX+2];
  574. //IdmaDmxW(0,((DWORD)bProgLen)<<8,DSP_W16); //set idma and change length from sector to 16bis
  575. if(obPMSIZE&0x80) //16bit mode
  576. IdmaDmxW(0,((DWORD)bProgLen)<<8,DSP_W16); //set idma and change length from sector to 16bis
  577. else //24bit mode
  578. IdmaDmxW(0,(((DWORD)bProgLen)<<9)/3,DSP_W24);
  579. if(!NandReadPhySec(wProgAddr,bProgLen,0xFFFF))
  580. goto Err_Dsp_Download;
  581. }
  582. if(NandReadPhySec(gxwAddrPMI,1,SRAM_DATA_ADDR)) //Download DMY
  583. {
  584. wProgAddr=(((WORD)gxbFsData[PM_DSP_JPG_DMY+1])<<8)|gxbFsData[PM_DSP_JPG_DMY];
  585. bProgLen=gxbFsData[PM_DSP_JPG_DMY+2];
  586. //IdmaDmyW(0x2000,(((DWORD)bProgLen)<<9)/3,DSP_W24); //set idma and change length from sector to 24 bits
  587. IdmaDmyW(wDmyStrAddr,(((DWORD)bProgLen)<<9)/3,DSP_W24);
  588. if(!NandReadPhySec(wProgAddr,bProgLen,0xFFFF))
  589. goto Err_Dsp_Download;
  590. }
  591. obIDMACTRL&=IDMA_ACT_DIS;
  592. return TRUE;
  593. Err_Dsp_Download:
  594.  IDMA_REQUEST_DISABLE();
  595.  DSP_RESET();
  596.  DSP_ENABLE(); //Dsp normal
  597. return FALSE;
  598. }
  599. //void JpgInitial()  //Walace060816#4 
  600. BOOL JpgInitial()  
  601. {
  602. //3. == file variable initial and open file ==========
  603.     gfGetPhoConfig=FALSE;
  604.  //   gxdwBlockTotalNum =0; //Walace051202#2
  605.     gxwMcuSize=0;
  606.     gxwBlockHeight=0;
  607.     gxwBlockWidth=0;
  608.     gxwBlockColNum=0;
  609.     gxwBlockPageNum=0;
  610.     gxdwCurrentBlockNum=0;
  611.     gdwFileSector=0;
  612.     gxwPhoWidth=0;
  613.     gxwPhoHeight=0;
  614. //Walace05121#FullScreen
  615.     gxwXStart=0;
  616.     gxwYStart=0;
  617.     gxwXPixel=0;
  618.     gxwYPixel=0;
  619.     gxwXStep=0;
  620.     gxwYStep=0;
  621.     gxwXStepStart=0;
  622.     gxwYStepStart=0;
  623. //==========================
  624.      //Walace060309#3 start
  625.       obSYSINT0MASK &= (~(CDC_INT_EN|I2S_INT_EN));  
  626.       JpegDspInit();
  627.       ClkDspEn();
  628.  
  629.       if(!DownloadJpegDsp())  //Walace060816#4 start
  630. {  
  631. gxbErrCode = ERR_PE_DSP_CODE_ERROR;
  632. return FALSE;   
  633.        }
  634.      //Walace060309#3 end   
  635.      #if(OLED_COLOR_FIELD_TYPE==OLED_FIELD_BGR565)      //Walace051115#1
  636.      JpgSetMonitorSizeTypeToDsp(UI_PHOTO_DISP_SIZE_COL,UI_PHOTO_DISP_SIZE_ROW,DSP_JPG_COLOR_CODE_BGR);  //Walace060320#3
  637.      #else 
  638.      JpgSetMonitorSizeTypeToDsp(UI_PHOTO_DISP_SIZE_COL,UI_PHOTO_DISP_SIZE_ROW,DSP_JPG_COLOR_CODE_RGB);  //Walace060320#3 
  639.      #endif
  640.  
  641.      SetDspStart();
  642.  
  643.      return TRUE; //Walace060816#4
  644. }
  645. //Walace060816#4 start 
  646. #define JPEG_FORMAT_CHECK_TAG 0x01
  647. #define JPEG_FORMAT_CHECK_TYPE 0x02
  648. //===================================
  649. // No differential , Huffman coding
  650. #define JPEG_FORMAT_HUFF_BASELINE 0xC0           
  651. #define JPEG_FORMAT_HUFF_SEQ 0xC1    
  652. #define JPEG_FORMAT_HUFF_PRG 0xC2          
  653. #define JPEG_FORMAT_HUFF_LOSS 0xC3         
  654. //===================================
  655. // Differential , Huffman coding
  656. #define JPEG_FORMAT_HUFF_DIFF_SEQ 0xC5
  657. #define JPEG_FORMAT_HUFF_DIFF_PRG 0xC6
  658. #define JPEG_FORMAT_HUFF_DIFF_LOSS 0xC7
  659. //===================================
  660. // No differential , Arithmetic coding
  661. #define JPEG_FORMAT_RESERVED 0xC8
  662. #define JPEG_FORMAT_ARI_SEQ 0xC9    
  663. #define JPEG_FORMAT_ARI_PRG 0xCA          
  664. #define JPEG_FORMAT_ARI_LOSS 0xCB    
  665. //===================================
  666. // Differential , Arithmetic coding
  667. #define JPEG_FORMAT_ARI_DIFF_SEQ 0xCD    
  668. #define JPEG_FORMAT_ARI_DIFF_PRG 0xCE          
  669. #define JPEG_FORMAT_ARI_DIFF_LOSS 0xCF    
  670. #if(1) //Walace060915#1 start
  671. //Walace060926#1 VideoResume
  672. //Remove ParserGetField() to Common.c and Common.h
  673. #define JPEG_MAKER 0xFF
  674. #define SOF0 0xFFC0
  675. #define SOF1 0xFFC1
  676. #define SOF2 0xFFC2
  677. #define SOF3 0xFFC3
  678. #define SOF5 0xFFC5
  679. #define SOF6 0xFFC6
  680. #define SOF7 0xFFC7
  681. #define JPEG_RESERVE 0xFFC8
  682. #define SOF9 0xFFC9
  683. #define SOF10 0xFFCA
  684. #define SOF11 0xFFCB
  685. #define SOF13 0xFFCD
  686. #define SOF14 0xFFCE
  687. #define SOF15 0xFFCF
  688. #define DHT 0xFFC4
  689. #define DAC 0xFFCC
  690. #define RST0 0xFFD0
  691. #define RST1 0xFFD1
  692. #define RST2 0xFFD2
  693. #define RST3 0xFFD3
  694. #define RST4 0xFFD4
  695. #define RST5 0xFFD5
  696. #define RST6 0xFFD6
  697. #define RST7 0xFFD7
  698. #define SOI 0xFFD8
  699. #define EOI 0xFFD9
  700. #define SOS 0xFFDA
  701. #define DQT 0xFFDB
  702. #define DNL 0xFFDC
  703. #define DRI  0xFFDD
  704. #define DHP 0xFFDE
  705. #define EXP 0xFFDE
  706. #define APP0 0xFFE0
  707. #define APP1 0xFFE1
  708. #define JPG0 0xFFF0 //0xFFF0~0xFFFD
  709. #define COM 0xFFFE 
  710. #define FIRST_SEARCH TRUE
  711. #define CONT_SEARCH FALSE
  712. #define REVERSE_DATA TRUE
  713. #define NORMAL_DATA FALSE
  714. #define GET_MARKER 0x01
  715. #define GET_SOI_MAKER 0x02
  716. BOOL SearchSoiInAppn(PWORD pwAddrOffset) 
  717. {
  718. BYTE bStates;
  719. WORD wLength;
  720. BYTE bTemp;
  721. ParserGetField(&wLength, 2, pwAddrOffset, FIRST_SEARCH, NORMAL_DATA);
  722. wLength -= 2; //substract 2 bytes length field
  723. //Walace070429#1
  724. (*pwAddrOffset)+=wLength;
  725. return TRUE;
  726. bStates=GET_MARKER;
  727. while(wLength)
  728. {
  729. ParserGetField(&bTemp, 1, pwAddrOffset, FIRST_SEARCH, NORMAL_DATA);
  730. wLength--;
  731. switch(bStates)
  732. {
  733. case GET_MARKER:
  734. if(bTemp==JPEG_MAKER)
  735. bStates=GET_SOI_MAKER;
  736. break;
  737. case GET_SOI_MAKER:
  738. if(bTemp==(SOI&JPEG_MAKER))
  739. {
  740. return TRUE; 
  741. }
  742. else if(bTemp!=JPEG_MAKER)
  743. {
  744. bStates=GET_MARKER;    
  745. }
  746. break;   
  747. }
  748. }
  749. return FALSE;
  750. }
  751. BOOL JpegFormatCheck()
  752. {
  753. WORD wMaker,wAddrOffset,wLength;
  754. BYTE bKeepSpeed;
  755. //BYTE bKey;
  756. //WORD wCounter;
  757. BOOL fAppSpace;
  758. bKeepSpeed = obCLKMCUDIVF;
  759. SetSysSpeed(0x02);
  760. gxbErrCode = ERR_NO_ERROR;
  761. wLength=0;
  762. wAddrOffset = 512; //for read a sector in ParserGetField
  763. gdwFileSector = 0;
  764. //wCounter=0;
  765. if(!ParserGetField(&wMaker, 2, &wAddrOffset, FIRST_SEARCH, NORMAL_DATA))
  766. goto END_PARSE;
  767. //bKey=KEY_INVALID;
  768. fAppSpace = FALSE;
  769. if(wMaker!=SOI)
  770. {
  771. gxbErrCode = ERR_PE_UNSUPPORT_FORMAT;
  772. goto END_PARSE;
  773. }
  774. while(TRUE)
  775. {
  776. if(!ParserGetField(&wMaker, 2, &wAddrOffset, FIRST_SEARCH, NORMAL_DATA))
  777. goto END_PARSE;
  778. switch(wMaker)
  779. case SOF0:
  780. case SOF2: //Walace070103#1
  781. goto END_PARSE;
  782. case SOF1:
  783. //case SOF2: //Walace070103#1
  784. case SOF3:
  785. case SOF5:
  786. case SOF6:
  787. case SOF7:
  788. case SOF9:
  789. case SOF10:
  790. case SOF11:
  791. case SOF13:
  792. case SOF14:
  793. case SOF15:
  794. gxbErrCode = ERR_PE_UNSUPPORT_FORMAT;
  795. goto END_PARSE;
  796.    case SOI:  
  797.    case EOI: 
  798.        case SOS:
  799.     break;
  800. case APP0:
  801. case APP1: 
  802. if(!fAppSpace)
  803. {
  804. fAppSpace = SearchSoiInAppn(&wAddrOffset);
  805. break;
  806. }
  807. default:
  808. if(!ParserGetField(&wLength, 2, &wAddrOffset, FIRST_SEARCH, NORMAL_DATA))
  809. goto END_PARSE;
  810. wAddrOffset += wLength-2;
  811. break;
  812. }
  813. }
  814. END_PARSE:
  815. gdwFileSector=0;
  816. SetSysSpeed(bKeepSpeed);
  817. if(gxbErrCode==ERR_FS_EOF)
  818. {
  819. gxbErrCode=ERR_PE_UNSUPPORT_FORMAT;
  820. }
  821. return (gxbErrCode==ERR_NO_ERROR);
  822. }
  823. #else
  824. BOOL JpegFormatCheck()
  825. {
  826. BYTE bKeepSpeed;
  827. BYTE bCheckState;
  828. WORD wDataIndex;
  829. bCheckState = JPEG_FORMAT_CHECK_TAG;
  830. bKeepSpeed = obCLKMCUDIVF;
  831. SetSysSpeed(0x02);
  832. gdwFileSector=0;
  833. while(gdwFileSector<(stPhoFileInf.dwFileTotalSector))
  834. {
  835. if(!FsReadFileSectorNew(gdwFileSector++,FS_DATA_0_0)) //read a sector
  836. return FALSE;
  837. wDataIndex=0;
  838. while(wDataIndex<512)
  839. {
  840. switch(bCheckState)
  841. {
  842. case JPEG_FORMAT_CHECK_TAG:
  843. if(gxbFsData[wDataIndex+gxwOffsetDataSec]==0xFF)
  844. bCheckState=JPEG_FORMAT_CHECK_TYPE;
  845. break;
  846. case JPEG_FORMAT_CHECK_TYPE:
  847. switch(gxbFsData[wDataIndex+gxwOffsetDataSec])
  848. {
  849. case JPEG_FORMAT_HUFF_BASELINE:
  850. /* Walace060818#1
  851. case JPEG_FORMAT_HUFF_SEQ:
  852. case JPEG_FORMAT_HUFF_LOSS:
  853. case JPEG_FORMAT_HUFF_DIFF_SEQ:
  854. case JPEG_FORMAT_HUFF_DIFF_LOSS:
  855. case JPEG_FORMAT_ARI_SEQ:
  856. case JPEG_FORMAT_ARI_LOSS:
  857. case JPEG_FORMAT_ARI_DIFF_SEQ:
  858. case JPEG_FORMAT_ARI_DIFF_LOSS:
  859. */
  860. gdwFileSector=0;
  861. SetSysSpeed(bKeepSpeed);
  862. return TRUE;
  863. case JPEG_FORMAT_HUFF_PRG:
  864. case JPEG_FORMAT_HUFF_DIFF_PRG:
  865. case JPEG_FORMAT_ARI_PRG:
  866. case JPEG_FORMAT_ARI_DIFF_PRG:
  867. // Walace060818#1
  868. case JPEG_FORMAT_HUFF_SEQ:
  869. case JPEG_FORMAT_HUFF_LOSS:
  870. case JPEG_FORMAT_HUFF_DIFF_SEQ:
  871. case JPEG_FORMAT_HUFF_DIFF_LOSS:
  872. case JPEG_FORMAT_ARI_SEQ:
  873. case JPEG_FORMAT_ARI_LOSS:
  874. case JPEG_FORMAT_ARI_DIFF_SEQ:
  875. case JPEG_FORMAT_ARI_DIFF_LOSS:
  876. //
  877. goto JPEG_TYPE_CHECK_END;
  878. default:
  879. bCheckState=JPEG_FORMAT_CHECK_TAG;
  880. break;
  881. }
  882. break;
  883. }
  884. wDataIndex++;
  885. }
  886. }
  887. JPEG_TYPE_CHECK_END:
  888. gdwFileSector=0;
  889. gxbErrCode = ERR_PE_UNSUPPORT_FORMAT;
  890. SetSysSpeed(bKeepSpeed);
  891. return FALSE;
  892. }
  893. #endif
  894. //Walace060816#4 end
  895. //Walace060915#1 end
  896. //Walace060816#4 start
  897. BOOL JpgDispProcess(BYTE bJpgCmd)  
  898. {
  899.   if(bJpgCmd==JPG_CMD_START)
  900.   {
  901.    gxbJpgProcState = JPG_PRC_INITIAL;
  902.   }
  903.   else if(bJpgCmd==JPG_CMD_CHECK_FORMAT)
  904.   {
  905.    gxbJpgProcState=JPG_PRC_IDLE;
  906. switch(gxbPhotoType)
  907. {   
  908. case PHO_TYPE_JPG:
  909.           return JpegFormatCheck();
  910. #if(PHOTO_BMP_DSP_DECODE)
  911. case PHO_TYPE_BMP:
  912.         return BmpFormatCheck();
  913. #endif
  914. }
  915.   }
  916.   
  917.   switch(gxbJpgProcState)
  918.   {
  919.    case JPG_PRC_IDLE:
  920.     break;
  921.    case JPG_PRC_INITIAL:
  922.     #if(DSP_BMP_DEBUG)
  923.     BmpDspDebug();
  924. #endif
  925. if(JpgInitial())
  926. gxbJpgProcState = JPG_PRC_DATA_TO_DSP;
  927. else
  928. gxbJpgProcState = JPG_PRC_END;
  929.     break;
  930.    case JPG_PRC_DATA_TO_DSP:
  931.     if(JpgFillDataToDsp())
  932.          gxbJpgProcState = JPG_PRC_GET_FROM_DSP;
  933. else
  934.             //gxbJpgProcState = JPG_PRC_ERR; 
  935.             gxbJpgProcState = JPG_PRC_END;
  936.     break;
  937.    case JPG_PRC_GET_FROM_DSP:
  938.     /* 
  939.     if(JpgGetImageFromDsp())
  940.    gxbJpgProcState = JPG_PRC_SHOW;
  941. else
  942. gxbJpgProcState = JPG_PRC_DATA_TO_DSP;
  943.     break;
  944.     */    
  945.     switch(JpgGetImageFromDsp())
  946.     {
  947.     case GET_JPEG_DATA_NONE:
  948. gxbJpgProcState = JPG_PRC_DATA_TO_DSP;
  949. break;
  950. case GET_JPEG_DATA_DONE:
  951. gxbJpgProcState = JPG_PRC_SHOW;
  952. break;
  953. case GET_JPEG_CONFIG_ERR:
  954. gxbJpgProcState = JPG_PRC_END;
  955. break;
  956.     }
  957. break;
  958.    case JPG_PRC_SHOW:
  959.     if(JpgBmpShow())    //Walace061018#2 bmp dsp decode
  960.              gxbJpgProcState = JPG_PRC_END;
  961.        else             
  962.      gxbJpgProcState = JPG_PRC_DATA_TO_DSP;
  963.            break;
  964.    case JPG_PRC_END:       
  965.      gxbJpgProcState = JPG_PRC_IDLE;
  966.  return TRUE;
  967.   }
  968.   return FALSE;
  969. }
  970. //Walace060816#4 ebd
  971. #endif //#if(PHOTO_SUPPORT_JPG)
  972. #if(DSP_BMP_DEBUG)
  973. void BmpDspDebug(void)
  974. {
  975. WORD wDspVal;
  976. SetSysSpeed(0x02);
  977. JpgInitial();
  978. while(1)
  979. {
  980. JpgFillDataToDsp();
  981. if(CheckImageOut()==DSP_REQ_START)
  982. {
  983. wDspVal=DSP_REQ_END;
  984. IdmaPioDmxW(&wDspVal, DSP_JPG_INPUT_FLAG, 1, DSP_W16); //Set finish data transfer
  985. }
  986. if(gdwFileSector<(stPhoFileInf.dwFileTotalSector))
  987. {
  988. OledShowNumber(1234,WORD0,LINE0,4);
  989. while(1){}
  990. }
  991. }
  992. }
  993. #endif
  994. //================= =============================================