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

📄 main.lst

📁 freescale 协处理器应用相关实例
💻 LST
📖 第 1 页 / 共 5 页
字号:
ANSI-C/cC++ Compiler for HC12 V-5.0.30 Build 6157, Jun  7 2006

    1:  /******************************************************************************
    2:  													            Copyright (c) Freescale 2006
    3:  File Name    : $RCSfile: main.c,v $
    4:  
    5:  Current Revision :	$Revision: 1.1 $
    6:  
    7:  PURPOSE: main program entry.                       
    8:                                                                            
    9:                                                                         
   10:  DESCRIPTION:  function main() providing initial program entry.
   11:                function Delay() - simple software delay
   12:                ISR definitions for non maskable CPU interrupts                                             
   13:                                                                            
   14:  UPDATE HISTORY                                                            
   15:  REV  AUTHOR    DATE        DESCRIPTION OF CHANGE                          
   16:  ---  ------    --------    ---------------------                          
   17:  1.0  r32151    01/03/05    - initial coding
   18:  1.1  r32151    26/01/06    - general clean up. 
   19:                               Removed all MPU code.
   20:                               Added NOPs in front of BGND instructions. in ISRs             
   21:                
   22:  
   23:       *******************************************************************
   24:       * File created by: Freescale East Kilbride MCD Applications Group *
   25:       *******************************************************************
   26:  
   27:                                                                            
   28:  ******************************************************************************/
   29:  /*===========================================================================*/
   30:  /* Freescale reserves the right to make changes without further notice to any*/
   31:  /* product herein to improve reliability, function, or design. Freescale does*/
   32:  /* not assume any  liability arising  out  of the  application or use of any */
   33:  /* product,  circuit, or software described herein;  neither  does it convey */
   34:  /* any license under its patent rights  nor the  rights of others.  Freescale*/
   35:  /* products are not designed, intended,  or authorized for use as components */
   36:  /* in  systems  intended  for  surgical  implant  into  the  body, or  other */
   37:  /* applications intended to support life, or  for any  other application  in */
   38:  /* which the failure of the Freescale product  could create a situation where*/
   39:  /* personal injury or death may occur. Should Buyer purchase or use Freescale*/
   40:  /* products for any such intended  or unauthorized  application, Buyer shall */
   41:  /* indemnify and  hold  Freescale  and its officers, employees, subsidiaries,*/
   42:  /* affiliates,  and distributors harmless against all claims costs, damages, */
   43:  /* and expenses, and reasonable  attorney  fees arising  out of, directly or */
   44:  /* indirectly,  any claim of personal injury  or death  associated with such */
   45:  /* unintended or unauthorized use, even if such claim alleges that  Freescale*/
   46:  /* was negligent regarding the  design  or manufacture of the part. Freescale*/
   47:  /* and the Freescale logo* are registered trademarks of Freescale Ltd.       */
   48:  /*****************************************************************************/
   49:  
   50:  /************************* Include Files *************************************/
   51:  /*general includes */
   52:  #include <hidef.h>  /* also includes boolean definitions in stdtypes.h     */
   53:  #include "s12x_peripherals.h"
   54:  #include "target.h" /* includes peripherals definitions and FSL data types */
   55:  #include "interruptConfig.h"
   56:  #include "sys_params.h"
   57:  /*application includes */
   58:  #include "main.h"
   59:  #include "s12_io.h"
   60:  /*driver includes */
   61:  #include "S12XE_Flash.h"
   62:  
   63:  
   64:  /************************* typedefs ******************************************/
   65:  /* check main.h */
   66:  /************************* #defines ******************************************/
   67:  /* check main.h */
   68:  
   69:        /**** SET THE SIZE OF THE EEE HERE ****/
   70:  
   71:  #define EEE_SECTORS 16          /* x256 bytes ~ can be 0 to 16*/
   72:  
   73:  
   74:        /**** THESE DFPART MACROS ASSUME MINIMUM EEE RAM/NVM RATIO ****/
   75:        /**** REPLACE / MODIFY THEM IF A LARGER RATIO IS REQUIRED  ****/ 
   76:  
   77:  
   78:  #if(EEE_SECTORS == 1)
   79:     #define DFPART (128 - 12)
   80:  #else
   81:     #define DFPART (128 - (8 * EEE_SECTORS))
   82:  #endif
   83:  
   84:  /* define the symbols to be used: */
   85:    __SEG_START_DEF(SYSTEM_DATA); // start of system parameter variables
   86:    __SEG_SIZE_DEF(SYSTEM_DATA);  // size of system parameter variables
   87:   
   88:    
   89:  
   90:  /************************* Constants *****************************************/        
   91:  #pragma CONST_SEG DEFAULT        
   92:  /************************* Global Variables **********************************/
   93:  #pragma DATA_SEG SHARED_DATA
   94:  
   95:  #pragma DATA_SEG EEPROM_DATA
   96:  
   97:  volatile tU16 EEE_Int[8];     /* Array situated in EEE RAM */
   98:                                /* volatile so we can always see the access */
   99:                                   /* for evaluation purposes only */
  100:  #pragma DATA_SEG DEFAULT
  101:  
  102:  /************************* function prototypes *******************************/
  103:  /* in s12x_vectors.h */
  104:  #pragma CODE_SEG DEFAULT
  105:  
  106:  /************************* Functions *****************************************/
  107:  #pragma CODE_SEG DEFAULT
  108:  
  109:  /******************************************************************************
  110:  Function Name  : main
  111:  Engineer       : r32151	
  112:  Date           : 01/03/2005
  113:  Parameters     : NONE
  114:  Returns        : NONE
  115:  Notes          : main routine called by Startup.c. 
  116:  ******************************************************************************/
  117:  
  118:  void main(void) 
  119:  {

Function: main
Source  : D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\main.c
Options : -CPUHCS12XE -D__FAR_DATA -D__NO_FLOAT__ -Env"GENPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"LIBPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"OBJPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Env"TEXTPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Lasm=%n.lst -Mb -ObjN="D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Example_9_Data\Flash_P&E_target\ObjectCode\main.c.o" -WmsgSd1106

  0000 1b90         [2]     LEAS  -16,SP
  120:     volatile tU16 temp = 0;
  0002 c7           [1]     CLRB  
  0003 87           [1]     CLRA  
  0004 6c81         [2]     STD   1,SP
  121:     volatile tU08 ftmStat; 
  122:     volatile tU16 ErrorCount = 0;
  0006 6c8e         [2]     STD   14,SP
  123:     tU08 *__far src_ptr_f08, *__far dst_ptr_f08;
  124:     int i;
  125:     tU08 checkSum = 0;
  0008 6b8c         [2]     STAB  12,SP
  126:     unsigned char dfPart, erPart;
  127:  
  128:     while (!FTM.fstat.bit.ccif) {					/* wait for FTM reset to complete */
  000a 1f000080fb   [5]     BRCLR FTM:6,#128,*+0 ;abs = 000a
  129:     }
  130:  
  131:  
  132:  
  133:  
  134:  
  135:     FTM.fclkdiv.byte  = FCLK_DIV;      /* write the flash clock divider */
  000f c604         [1]     LDAB  #4
  0011 7b0000       [3]     STAB  FTM
  136:                                      /* before launching first FTM command */
  137:                                      /* but after CCIF flag has set */
  138:     if(FTM.fclkdiv.byte != (FCLK_DIV | 0x80))
  0014 b60000       [3]     LDAA  FTM

⌨️ 快捷键说明

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