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

📄 bench.lst

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 LST
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/EC++ Compiler V3.10A/W32              05/Nov/2001  14:58:23 #
# Copyright 1999-2001 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode     =  arm                                                     #
#    Code model   =  small                                                   #
#    Endian       =  little                                                  #
#    Source file  =  C:\At91\software\projects\bench\Source\bench.c          #
#    Command line =  -I C:\Compil\EW23\ARM\INC\ -I ../../..\ -lcN            #
#                    C:\At91\software\projects\bench\IAR\ARM_INT\List\ -la   #
#                    C:\At91\software\projects\bench\IAR\ARM_INT\List\ -o    #
#                    C:\At91\software\projects\bench\IAR\ARM_INT\Obj\ -e     #
#                    -s9 --debug --cpu_mode arm --code_model small --endian  #
#                    little --cpu=arm7tdmi C:\At91\software\projects\bench\S #
#                    ource\bench.c                                           #
#    List file    =  C:\At91\software\projects\bench\IAR\ARM_INT\List\bench. #
#                    lst                                                     #
#    Object file  =  C:\At91\software\projects\bench\IAR\ARM_INT\Obj\bench.r #
#                    79                                                      #
#                                                                            #
#                                                                            #
##############################################################################

C:\At91\software\projects\bench\Source\bench.c
      1          //*----------------------------------------------------------------------------
      2          //*      ATMEL Microcontroller Software Support  -  ROUSSET  -
      3          //*----------------------------------------------------------------------------
      4          //* The software is delivered "AS IS" without warranty or condition of any
      5          //* kind, either express, implied or statutory. This includes without
      6          //* limitation any warranty or condition with respect to merchantability or
      7          //* fitness for any particular purpose, or against the infringements of
      8          //* intellectual property rights of others.
      9          //*----------------------------------------------------------------------------
     10          //* File Name           : bench.c
     11          //* Object              : bench
     12          //*
     13          //* 1.0 15/05/01 JPP    : Creation
     14          //*----------------------------------------------------------------------------
     15          
     16          #include    "parts/r40807/lib_r40807.h"
     17          #include    "targets/eb40/eb40.h"
     18          #include     "com.h"
     19          
     20          #include     <stdio.h>
     21          
     22          extern void at91_tc_open_count( const TCBlockDesc *TC_pt );
     23          extern void at91_tc_start( const TCBlockDesc *TC_pt );
     24          extern u_int at91_tc_stop( const TCBlockDesc *TC_pt );
     25          extern void testloop(int Number_Of_Runs) ;
     26          extern void testloop1(void) ;
     27          
     28          #define MCKI            32768000
     29          #define BAUD_RATE       38400
     30          
     31          char message[512];
     32          ComDesc COM;
     33          static const char atmel_header[]=
     34          {
     35          "\n\r    *** ATMEL USART BENCHMARK ***\n\r"
     36          "Copyright (C) 2001 ATMEL Version 1.0\n\r"
     37          };
     38          	u_int result_out,result ;
     39          
     40          
     41          //*----------------------------------------------------------------------------
     42          //* Function Name       : main
     43          //* Object              : Main function of the led blink
     44          //* Input Parameters    : none
     45          //* Output Parameters   : TRUE
     46          //*----------------------------------------------------------------------------
     47          void  main( void )
     48          //* Begin
     49          {
     50              u_short cd_baud;
     51          	u_int result_out,result ;
     52          	u_int cmpt;
     53          //* Init
     54              //* define led at PIO output
     55              at91_pio_open ( &PIO_DESC, LED_MASK, PIO_OUTPUT );
     56          
     57               //* Init LED state
     58              at91_pio_write ( &PIO_DESC, LED_MASK, PIO_CLEAR_OUT );
     59          
     60              //* define switch at PIO input
     61              at91_pio_open ( &PIO_DESC, SW_MASK, PIO_INPUT );
     62          
     63              //* Init timer
     64          
     65              //* open terminal for console
     66              COM.usart=&USART0_DESC;
     67              cd_baud = at91_baud_com(MCKI, BAUD_RATE);
     68              //* open com
     69              at91_open_com(&COM,(COM_8_BIT|COM_PAR_NONE|COM_NBSTOP_1|COM_FLOW_CONTROL_NONE), cd_baud);
     70              at91_print(&COM,message);
     71              at91_print_frame(&COM,(char *)atmel_header,sizeof(atmel_header));
     72              
     73          for (;;)
     74              {
     75          	    //* check switch SW5 is push wait
     76          		if (( at91_pio_read ( &PIO_DESC) & SW5_MASK ) == SW5_MASK )
     77          		{ 	// if switch
     78             			at91_print(&COM,"** Mearsure **\n\r");
     79          			at91_pio_write ( &PIO_DESC, LED1, PIO_SET_OUT );
     80          			// open timer &TCB0_DESC
     81          			at91_tc_open_count(&TCB_DESC);
     82          			//* Start timer
     83          			at91_tc_start(&TCB_DESC);
     84          
     85          			//* Stop timer
     86          			result_out= at91_tc_stop(&TCB_DESC );
     87          			sprintf(message,"- Out test %d \n\r",result_out);
     88          			at91_print(&COM,message);
     89          			// open timer &TCB0_DESC
     90          			at91_tc_open_count(&TCB_DESC);
     91          			//* Start timer
     92          			at91_tc_start(&TCB_DESC);
     93          			cmpt++;
     94          			result= at91_tc_stop(&TCB_DESC );
     95          			sprintf(message,"- cmpt++ test total:%d test:%d\n\r",result,result-result_out);
     96             			at91_print(&COM,message);
     97          
     98          			// open timer &TCB0_DESC
     99          			at91_tc_open_count(&TCB_DESC);
    100          	     	//* Start timer
    101          			at91_tc_start(&TCB_DESC);
    102          
    103          			// start test
    104          			testloop(10000);
    105          
    106          			result= at91_tc_stop(&TCB_DESC );
    107          			sprintf(message,"- testloop  total %d testloop %d\n\r",result,result-result_out);
    108             			at91_print(&COM,message);
    109          
    110          		// send result
    111          		at91_pio_write ( &PIO_DESC, LED1, PIO_CLEAR_OUT );
    112          		}
    113              }
    114          
    115          //* End
    116          }
    117          

   Maximum stack usage in bytes:

     Function  CSTACK
     --------  ------
     main         28 

 
 178 bytes in segment HUGE_C    
 528 bytes in segment HUGE_Z    
  12 bytes in segment INITTAB   
 424 bytes in segment NEARFUNC_A
 
 424 bytes of CODE      memory (+ 12 bytes shared)
 178 bytes of HUGECONST memory
 528 bytes of HUGEDATA  memory

Errors: none
Warnings: none

⌨️ 快捷键说明

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