⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guidev_banding.lst

📁 Keil C下通过的UCGUI,UCGUI的移植源代码
💻 LST
字号:
C51 COMPILER V8.05a   GUIDEV_BANDING                                                       04/11/2008 14:19:28 PAGE 1   


C51 COMPILER V8.05a, COMPILATION OF MODULE GUIDEV_BANDING
OBJECT MODULE PLACED IN GUIDEV_Banding.obj
COMPILER INVOKED BY: D:\Program Files\keil\C51\BIN\C51.EXE gui\MemDev\GUIDEV_Banding.c LARGE BROWSE MDU_F120 DEBUG OBJEC
                    -TEXTEND PRINT(.\GUIDEV_Banding.lst) OBJECT(GUIDEV_Banding.obj)

line level    source

   1          /*
   2          *********************************************************************************************************
   3          *                                                uC/GUI
   4          *                        Universal graphic software for embedded applications
   5          *
   6          *                       (c) Copyright 2002, Micrium Inc., Weston, FL
   7          *                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
   8          *
   9          *              礐/GUI is protected by international copyright laws. Knowledge of the
  10          *              source code may not be used to write a similar product. This file may
  11          *              only be used in accordance with a license and should not be redistributed
  12          *              in any way. We appreciate your understanding and fairness.
  13          *
  14          ----------------------------------------------------------------------
  15          File        : GUIDevB.C
  16          Purpose     : Implementation of banding memory devices
  17          ----------------------------------------------------------------------
  18          Version-Date---Author-Explanation
  19          ----------------------------------------------------------------------
  20                  010830 RS     GUI_MEMDEV_Draw now limits rectangle to
  21                                LCD area in order to avoid wasting computation time
  22                  001109 RS     Bugfix: x0 was changed to 0 when moving the
  23                                active area. Fixed.
  24          1.00    001015 RS     First release
  25          0.00.00 00     RS     Initial version for internal tests
  26          ----------------------------------------------------------------------
  27          Known problems or limitations with current version
  28          ----------------------------------------------------------------------
  29          None
  30          ---------------------------END-OF-HEADER------------------------------
  31          */
  32          
  33          
  34          #include <string.h>
  35          #include "gui\Core\GUI_Protected.h"
  36          #include "gui\Core\GUIDebug.h"
  37          /*
  38           Memory device capabilities are compiled only if support for them is enabled.
  39          */ 
  40          #if GUI_SUPPORT_MEMDEV
              
              /*
              *********************************************************
              *
              *              GUI_MEMDEV_Draw
              *
              *********************************************************
              
              This routine uses a banding memory device to draw the
              given area flicker free. It not only draws, but also
              automatically calculates the size of, creates, moves
              and then destroys the memory device.
              
              */
C51 COMPILER V8.05a   GUIDEV_BANDING                                                       04/11/2008 14:19:28 PAGE 2   

              
              static int Min(int v0, int v1) {
                if (v0 <= v1)
                  return v0;
                return v1;
              }
              
              int GUI_MEMDEV_Draw(GUI_RECT* pRect, GUI_CALLBACK_VOID_P* pfDraw, void* pData, int NumLines, int Flags) {
                int x0,y0, x1, y1, xsize, ysize;
                GUI_MEMDEV_Handle hMD;
                if (pRect) {
                  x0 = (pRect->x0 < 0) ? 0 : pRect->x0;
                  y0 = (pRect->y0 < 0) ? 0 : pRect->y0;
                  x1 = Min(pRect->x1, LCD_GET_XSIZE()-1);
                  y1 = Min(pRect->y1, LCD_GET_YSIZE()-1);
                  xsize = x1-x0+1;
                  ysize = y1-y0+1;
                } else {
                  x0 = 0;
                  y0 = 0;
                  xsize = LCD_GET_XSIZE();
                  ysize = LCD_GET_YSIZE();
                }
                if (NumLines == 0) {
                  NumLines = -ysize;   /* Request <ysize> lines ... Less is o.k. */
                }
                if ((xsize<=0) || (ysize<=0))
                  return 0;           /* Nothing to do ... */
              /* Create memory device */
                hMD = GUI_MEMDEV_CreateEx(x0,y0, xsize, NumLines, Flags);
                if (!hMD) {
                  GUI_DEBUG_ERROROUT("GUI_MEMDEV_Draw() Not enough memory ...");            /* Not enough memory ! */
                  pfDraw(pData);
                  return 1;
                }
                NumLines = GUI_MEMDEV_GetYSize(hMD);
                GUI_MEMDEV_Select(hMD);
              /* Start drawing ... */
                {
                  int i;
                  for (i=0; i< ysize; i+=NumLines) {
                    int RemLines = ysize-i;
                    if (RemLines<NumLines) {
                      GUI_MEMDEV_ReduceYSize(hMD, RemLines);
                    }
                    if (i) {
                      GUI_MEMDEV_SetOrg(hMD, x0, y0+i);
                      GUI_MEMDEV_Clear(hMD);
                    }
                    pfDraw(pData);
                    GUI_MEMDEV_CopyToLCD(hMD);
                  }
                }
                GUI_MEMDEV_Delete(hMD);
                GUI_MEMDEV_Select(0);
                return 0;             /* Success ! */
              }
              
              #else
 114          
 115          void GUIDEV_Banding(void) {} /* avoid empty object files */
 116          
C51 COMPILER V8.05a   GUIDEV_BANDING                                                       04/11/2008 14:19:28 PAGE 3   

 117          #endif /* GUI_MEMDEV_SUPPORT */


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =      1    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -