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

📄 main.lst

📁 This is example of using Atmel at89c5131 MCU with at49db11(spi dataflash) and epson s1d1335 graphic
💻 LST
字号:
C51 COMPILER V8.00   MAIN                                                                  04/09/2009 13:30:36 PAGE 1   


C51 COMPILER V8.00, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c LARGE BROWSE DEBUG OBJECTEXTEND

line level    source

   1          #include "spi.h"
   2          #include "flash.h"
   3          #include "kbd.h"
   4          #include "lcd.h"
   5          #include "font.h"
   6          #include "consts_structs.h"
   7          
   8          //--------------------------------------------------------
   9          void DrawCursor(int x1,int x2,int oldpos, int newpos)
  10          {
  11   1              if(oldpos >= 0)
  12   1                      fill_rect_gr((x1) << 3, (oldpos) << 4, (x2) << 3, (oldpos + 1) << 4, 0);
  13   1              if(newpos >= 0)
  14   1                      fill_rect_gr((x1) << 3, (newpos) << 4, (x2) << 3, (newpos + 1) << 4, 1);
  15   1      }
  16          
  17          
  18          void LoadFontToFlash()
  19          {
  20   1              unsigned short pageNum = 8,i,j; 
  21   1              OutStringXY("Erasing flash...",10,7);
  22   1              SpiEraseChip();
  23   1              OutStringXY("Loading font ...",10,7);
  24   1              i = 0;
  25   1              while(i<4096)
  26   1              {
  27   2                      for(j = 0; j < 264;j++)
  28   2                      {
  29   3                              flash_buf[j] = FNT_GOST[i];
  30   3                              i++;
  31   3                              if (i>4095) break;
  32   3                      }
  33   2                      SpiWritePage(pageNum,0,flash_buf,264);
  34   2                      pageNum++;
  35   2              }
  36   1              
  37   1      
  38   1              OutStringXY("Loading symbols ",10,7);
  39   1              SpiWritePage(SYMB_ZERO_PAGE,0,zero,256);
*** WARNING C182 IN LINE 39 OF MAIN.C: pointer to different objects
  40   1              SpiWritePage(SYMB_ONE_PAGE,0,one,256);
*** WARNING C182 IN LINE 40 OF MAIN.C: pointer to different objects
  41   1              SpiWritePage(SYMB_TWO_PAGE,0,two,256);
*** WARNING C182 IN LINE 41 OF MAIN.C: pointer to different objects
  42   1              SpiWritePage(SYMB_THREE_PAGE,0,three,256);
*** WARNING C182 IN LINE 42 OF MAIN.C: pointer to different objects
  43   1              SpiWritePage(SYMB_FOUR_PAGE,0,four,256);
*** WARNING C182 IN LINE 43 OF MAIN.C: pointer to different objects
  44   1              SpiWritePage(SYMB_FIVE_PAGE,0,five,256);
*** WARNING C182 IN LINE 44 OF MAIN.C: pointer to different objects
  45   1              SpiWritePage(SYMB_SIX_PAGE,0,six,256);
*** WARNING C182 IN LINE 45 OF MAIN.C: pointer to different objects
  46   1              SpiWritePage(SYMB_SEVEN_PAGE,0,seven,256);
*** WARNING C182 IN LINE 46 OF MAIN.C: pointer to different objects
  47   1              SpiWritePage(SYMB_EIGHT_PAGE,0,eight,256);
C51 COMPILER V8.00   MAIN                                                                  04/09/2009 13:30:36 PAGE 2   

*** WARNING C182 IN LINE 47 OF MAIN.C: pointer to different objects
  48   1              SpiWritePage(SYMB_NINE_PAGE,0,nine,256);
*** WARNING C182 IN LINE 48 OF MAIN.C: pointer to different objects
  49   1      
  50   1      
  51   1              SpiWritePage(SYMB_KILO_PAGE,0,kilo,256);
*** WARNING C182 IN LINE 51 OF MAIN.C: pointer to different objects
  52   1              SpiWritePage(SYMB_MILLI_PAGE,0,mil,144);
  53   1              SpiWritePage(SYMB_MICRO_PAGE,0,mic,144);
  54   1              SpiWritePage(SYMB_OMEGA_PAGE,0,om,144);
  55   1              OutStringXY("      OK!       ",10,7);
  56   1      }
  57          //--------------------------------------------------------------------------------------------
  58          void main()
  59          {
  60   1              unsigned short maxRow = 3, currentRow = 0,oldRow = 0, yOffset = 2;
  61   1      
  62   1              InitKbd();
  63   1              InitSpi();
  64   1              InitLCD();
  65   1              OutStringXY("Format flash",2,2);
  66   1              OutStringXY("Test 1",2,3);
  67   1              OutStringXY("Test 2",2,4);
  68   1              DrawCursor(1,15,oldRow + yOffset,currentRow + yOffset);
  69   1              while(1)
  70   1              {
  71   2                      switch(GetKey())
  72   2                      {
  73   3                              case KEY_DOWN:
  74   3                                      oldRow = currentRow;
  75   3                                      currentRow++;
  76   3                                      if (currentRow > maxRow -1 ) currentRow = 0;
  77   3                                      DrawCursor(1,15,oldRow + yOffset,currentRow + yOffset);
  78   3                              break;
  79   3      
  80   3                              case KEY_UP:
  81   3                                      oldRow = currentRow;
  82   3                                      if(currentRow > 0)
  83   3                                              currentRow--;
  84   3                                      else 
  85   3                                              currentRow = maxRow - 1;
  86   3                                      DrawCursor(1,15,oldRow + yOffset,currentRow + yOffset);
  87   3                              break;
  88   3      
  89   3                              case KEY_ENTER:
  90   3                                      if (currentRow == 0)
  91   3                                      {
  92   4                                              LoadFontToFlash();
  93   4                                      }
  94   3                              break;
  95   3                      }
  96   2              }       
  97   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1119    ----
   CONSTANT SIZE    =   8207    ----
   XDATA SIZE       =   ----      20
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
C51 COMPILER V8.00   MAIN                                                                  04/09/2009 13:30:36 PAGE 3   

   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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