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

📄 main.lst

📁 AT91M40800源码
💻 LST
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 EVALUATION    10/Sep/2008  16:13:47 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  E:\AT91EBxx\main.c                                   #
#    Command line    =  E:\AT91EBxx\main.c --fpu None -D RAMCODE=1 -lCN      #
#                       E:\AT91EBxx\ramcode-EBxx\List\ -o                    #
#                       E:\AT91EBxx\ramcode-EBxx\Obj\ -z3 --no_cse           #
#                       --no_unroll --no_inline --no_code_motion --no_tbaa   #
#                       --no_clustering --no_scheduling --debug --cpu_mode   #
#                       arm --endian little --cpu ARM7TDMI --stack_align 4   #
#                       --interwork -e --dlib_config "C:\Program Files\IAR   #
#                       Systems\Embedded Workbench 4.0                       #
#                       Evaluation\arm\LIB\dl4tpainl8n.h" -I "C:\Program     #
#                       Files\IAR Systems\Embedded Workbench 4.0             #
#                       Evaluation\arm\INC\"                                 #
#    List file       =  E:\AT91EBxx\ramcode-EBxx\List\main.lst               #
#    Object file     =  E:\AT91EBxx\ramcode-EBxx\Obj\main.r79                #
#                                                                            #
#                                                                            #
##############################################################################

E:\AT91EBxx\main.c
      1          
      2          /*
      3           * $Revision: 1.4 $
      4           */
      5          
      6          #include <stdio.h>
      7          #include <string.h>
      8          #include "config.h"
      9          #include "timer.h"
     10          #include "uart.h"
     11          #include "button.h"
     12          
     13          // LED moving pattern codes.
     14          static int led_table[] = {
     15            0x18, 0x3c, 0x7e, 0xff, 0xe7, 0xc3, 0x81, 0x42, 0x24, -1
     16          };
     17          
     18          static char sRxBuf[RXBUF_SIZE];  // Receive buffer.
     19          
     20          void LCDtest(void);
     21          void AT91UartPutchar(int ch);
     22          

   \                                 In segment CODE, align 4, keep-with-next
     23          void main(void)
     24          {
   \                     main:
   \   00000000   10402DE9           PUSH     {R4,LR}
   \   00000004   04D04DE2           SUB      SP,SP,#+4
     25            int n; // Number of received characters.
     26            int display;
     27            
     28            display=0xff;
   \   00000008   FF40A0E3           MOV      R4,#+255
     29          
     30            // Initialize UART module and register getchar/putchar callbacks.
     31            UartInit(AT91UartGetchar, AT91UartPutchar);
   \   0000000C   40109FE5           LDR      R1,??main_0      ;; AT91UartPutchar
   \   00000010   40009FE5           LDR      R0,??main_0+0x4  ;; AT91UartGetchar
   \   00000014   ........           _BLF     UartInit,??UartInit??rA
     32            // Initialize button module and register getbuttons callback.
     33            ButtonInit(AT91GetButtons);
   \   00000018   3C009FE5           LDR      R0,??main_0+0x8  ;; AT91GetButtons
   \   0000001C   ........           _BLF     ButtonInit,??ButtonInit??rA
     34            
     35            // Set up peripheral registers.
     36            // First disable interrupts.
     37            __disable_interrupt();
   \   00000020   ........           _BLF     ??DiI_a,??rA??DiI_a
     38            // Setup interrupt controller.
     39            AT91InitInterrupt(TimerBeat, UartRxrdy);
   \   00000024   34109FE5           LDR      R1,??main_0+0xC  ;; UartRxrdy
   \   00000028   34009FE5           LDR      R0,??main_0+0x10  ;; TimerBeat
   \   0000002C   ........           _BLF     AT91InitInterrupt,??AT91InitInterrupt??rA
     40            // Periodic timer initialization.
     41            AT91InitTimer();
   \   00000030   ........           _BLF     AT91InitTimer,??AT91InitTimer??rA
     42            // Setup serial port.
     43            AT91UartInit();
   \   00000034   ........           _BLF     AT91UartInit,??AT91UartInit??rA
     44            // Enable interrupts.
     45            __enable_interrupt();
   \   00000038   ........           _BLF     ??EnI_a,??rA??EnI_a
     46          
     47            // Start periodic timer.
     48            AT91StartTimer();
   \   0000003C   ........           _BLF     AT91StartTimer,??AT91StartTimer??rA
     49          
     50            // Initial LED pattern.
     51          //  AT91LedSet(0x18);
     52            // Display pattern for 1 second.
     53            Sleep(1000);
   \   00000040   FA0FA0E3           MOV      R0,#+1000
   \   00000044   ........           _BLF     Sleep,??Sleep??rA
     54            // Next LED pattern.
     55          //  AT91LedSet(0xc3);
     56            // Display pattern for 1 second.
     57            Sleep(1000);
   \   00000048   FA0FA0E3           MOV      R0,#+1000
   \   0000004C   ........           _BLF     Sleep,??Sleep??rA
     58          
     59            // Loop forever.
     60            for (;;)
   \                     ??main_1:
   \   00000050   FEFFFFEA           B        ??main_1
   \                     ??main_0:
   \   00000054   ........           DC32     AT91UartPutchar
   \   00000058   ........           DC32     AT91UartGetchar
   \   0000005C   ........           DC32     AT91GetButtons
   \   00000060   ........           DC32     UartRxrdy
   \   00000064   ........           DC32     TimerBeat
     61            {
     62          /*    int *ip;
     63          
     64              // Loop over all LED patterns in table.
     65              for (ip = led_table; *ip != -1; ip++)
     66              {
     67                // Update LED's.
     68                AT91LedSet(*ip);
     69                // Check serial port, timeout in milleseconds is second parameter.
     70                n = ReceiveLine(sRxBuf, led_slow_speed ? 200 : 75);
     71                // Repeat while characters are available.
     72                while (n)
     73                {
     74                  char str[64];
     75                  // Echo received character in TX message.
     76                  sprintf(str, "IAR Embedded Workbench for ARM, got char: %c\r\n", sRxBuf[0]);
     77                  SendLine(str);
     78                  // Show ASCII code on LED's.
     79                  AT91LedSet(sRxBuf[0]);
     80                  // Check for new character.
     81                  n = ReceiveLine(sRxBuf, 2000);
     82                  
     83          //        AT91LedSet(0);
     84          //       Sleep(1000);
     85          //        AT91LedSet(0xff);
     86                }
     87              }
     88              // Periodic TX message.
     89          //    SendLine("IAR Embedded Workbench for ARM, moving LED pattern\r\n");
     90          //    SendLine("abcdefghjklmnopqrstuvwxyz\r\n");
     91              if(display){LCDtest(); display=10;}//只进行一次显示操作 */
     92            }
     93          }

   Maximum stack usage in bytes:

     Function CSTACK
     -------- ------
     main        12


   Segment part sizes:

     Function/Label Bytes
     -------------- -----
     main            104
      Others         112

 
 216 bytes in segment CODE
 
 104 bytes of CODE memory (+ 112 bytes shared)

Errors: none
Warnings: 4

⌨️ 快捷键说明

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