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

📄 main.lst

📁 基于8051共享时钟调度器的can总线通讯
💻 LST
📖 第 1 页 / 共 3 页
字号:
  82      =1  
  83      =1  //------------------------------------------------------------------
  84      =1  // Error codes 
  85      =1  // - see Chapter 14. 
  86      =1  //------------------------------------------------------------------
  87      =1  
  88      =1  #define ERROR_SCH_TOO_MANY_TASKS (1)
  89      =1  #define ERROR_SCH_CANNOT_DELETE_TASK (2)
  90      =1  
  91      =1  #define ERROR_SCH_WAITING_FOR_SLAVE_TO_ACK (3)
  92      =1  #define ERROR_SCH_WAITING_FOR_START_COMMAND_FROM_MASTER (3)
  93      =1  
  94      =1  #define ERROR_SCH_ONE_OR_MORE_SLAVES_DID_NOT_START (4)
  95      =1  #define ERROR_SCH_LOST_SLAVE (5)
  96      =1  
  97      =1  #define ERROR_SCH_CAN_BUS_ERROR (6)
  98      =1  
  99      =1  #define ERROR_I2C_WRITE_BYTE (10)
 100      =1  #define ERROR_I2C_READ_BYTE (11)
 101      =1  #define ERROR_I2C_WRITE_BYTE_AT24C64 (12)
 102      =1  #define ERROR_I2C_READ_BYTE_AT24C64 (13)
 103      =1  #define ERROR_I2C_DS1621 (14)
 104      =1  
 105      =1  #define ERROR_USART_TI (21)
 106      =1  #define ERROR_USART_WRITE_CHAR (22)
 107      =1  
 108      =1  #define ERROR_SPI_EXCHANGE_BYTES_TIMEOUT (31)
 109      =1  #define ERROR_SPI_X25_TIMEOUT (32)
 110      =1  #define ERROR_SPI_MAX1110_TIMEOUT (33)
 111      =1  
 112      =1  #define ERROR_ADC_MAX150_TIMEOUT (44)
 113      =1  
 114      =1  #endif
 115      =1  
 116      =1  /*------------------------------------------------------------------*-
 117      =1    ---- END OF FILE -------------------------------------------------
 118      =1  -*------------------------------------------------------------------*/
  30          
  31          #include "LED_Flas.h"
   1      =1  /*------------------------------------------------------------------*-
   2      =1  
   3      =1     LED_flas.H (v1.00)
   4      =1  
   5      =1    ------------------------------------------------------------------
   6      =1     
   7      =1     - See LED_flas.C for details.
   8      =1  
   9      =1  
  10      =1     COPYRIGHT
C51 COMPILER V7.06   MAIN                                                                  12/25/2007 19:33:30 PAGE 7   

  11      =1     ---------
  12      =1  
  13      =1     This code is from the book:
  14      =1  
  15      =1     PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont 
  16      =1     [Pearson Education, 2001; ISBN: 0-201-33138-1].
  17      =1  
  18      =1     This code is copyright (c) 2001 by Michael J. Pont.
  19      =1   
  20      =1     See book for copyright details and other information.
  21      =1  
  22      =1  -*------------------------------------------------------------------*/
  23      =1  
  24      =1  // ------ Public function prototypes -------------------------------
  25      =1  
  26      =1  void LED_Flash_Init(void);
  27      =1  void LED_Flash_Update(void);
  28      =1  
  29      =1  /*------------------------------------------------------------------*-
  30      =1    ---- END OF FILE -------------------------------------------------
  31      =1  -*------------------------------------------------------------------*/
  32          #include "SCC_M515.H"
   1      =1  /*------------------------------------------------------------------*-
   2      =1    
   3      =1    SCC_M515.H (v1.00)
   4      =1  
   5      =1    ------------------------------------------------------------------
   6      =1  
   7      =1    - see SCC_M515.C for details
   8      =1  
   9      =1  
  10      =1     COPYRIGHT
  11      =1     ---------
  12      =1  
  13      =1     This code is from the book:
  14      =1  
  15      =1     PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont 
  16      =1     [Pearson Education, 2001; ISBN: 0-201-33138-1].
  17      =1  
  18      =1     This code is copyright (c) 2001 by Michael J. Pont.
  19      =1   
  20      =1     See book for copyright details and other information.
  21      =1  
  22      =1  -*------------------------------------------------------------------*/
  23      =1  
  24      =1  #include "Main.h"
   1      =2  /*------------------------------------------------------------------*-
   2      =2  
   3      =2     Main.H (v1.00)
   4      =2  
   5      =2    ------------------------------------------------------------------
   6      =2     
   7      =2     'Project Header' (see Chap 9) for project SCU_Cb (see Chap 27)
   8      =2  
   9      =2  
  10      =2     COPYRIGHT
  11      =2     ---------
  12      =2  
  13      =2     This code is from the book:
  14      =2  
  15      =2     PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont 
  16      =2     [Pearson Education, 2001; ISBN: 0-201-33138-1].
C51 COMPILER V7.06   MAIN                                                                  12/25/2007 19:33:30 PAGE 8   

  17      =2  
  18      =2     This code is copyright (c) 2001 by Michael J. Pont.
  19      =2   
  20      =2     See book for copyright details and other information.
  21      =2  
  22      =2  -*------------------------------------------------------------------*/
  23      =2  
  24      =2  #ifndef _MAIN_H
           =2 #define _MAIN_H
           =2 
           =2 //------------------------------------------------------------------
           =2 // WILL NEED TO EDIT THIS SECTION FOR EVERY PROJECT
           =2 //------------------------------------------------------------------
           =2 
           =2 // Must include the appropriate microcontroller header file here
           =2 #include <reg515c.h>
           =2 
           =2 // Include oscillator / chip details here 
           =2 // (essential if generic delays / timeouts are used)
           =2 //  -
           =2 // Oscillator / resonator frequency (in Hz) e.g. (11059200UL)
           =2 #define OSC_FREQ (10000000UL)
           =2 
           =2 // Number of oscillations per instruction (4, 6 or 12)
           =2 // 12 - Original 8051 / 8052 and numerous modern versions
           =2 //  6 - Various Infineon and Philips devices, etc.
           =2 //  4 - Dallas, etc.
           =2 //
           =2 // Take care with Dallas devices 
           =2 // - Timers default to *12* osc ticks unless CKCON is modified 
           =2 // - If using generic code on a Dallas device, use 12 here
           =2 #define OSC_PER_INST (6)
           =2 
           =2 //------------------------------------------------------------------
           =2 // SHOULD NOT NEED TO EDIT THE SECTIONS BELOW
           =2 //------------------------------------------------------------------
           =2 typedef unsigned char tByte;
           =2 typedef unsigned int  tWord;
           =2 typedef unsigned long tLong;
           =2 
           =2 // Misc #defines
           =2 #ifndef TRUE
           =2 #define FALSE 0
           =2 #define TRUE (!FALSE)
           =2 #endif
           =2 
           =2 #define RETURN_NORMAL (bit) 0
           =2 #define RETURN_ERROR (bit) 1
           =2 
           =2 
           =2 //------------------------------------------------------------------
           =2 // Interrupts
           =2 // - see Chapter 13.  
           =2 //------------------------------------------------------------------
           =2 
           =2 // Generic 8051/52 timer interrupts (used in most schedulers)
           =2 #define INTERRUPT_Timer_0_Overflow 1
           =2 #define INTERRUPT_Timer_1_Overflow 3
           =2 #define INTERRUPT_Timer_2_Overflow 5
           =2 
           =2 // Additional interrupts (used in shared-clock schedulers)
           =2 #define INTERRUPT_EXTERNAL_0 0
C51 COMPILER V7.06   MAIN                                                                  12/25/2007 19:33:30 PAGE 9   

           =2 #define INTERRUPT_EXTERNAL_1 2
           =2 #define INTERRUPT_UART_Rx_Tx 4
           =2 #define INTERRUPT_CAN_c515c 17
           =2 
           =2 //------------------------------------------------------------------
           =2 // Error codes 
           =2 // - see Chapter 14. 
           =2 //------------------------------------------------------------------
           =2 
           =2 #define ERROR_SCH_TOO_MANY_TASKS (1)
           =2 #define ERROR_SCH_CANNOT_DELETE_TASK (2)
           =2 
           =2 #define ERROR_SCH_WAITING_FOR_SLAVE_TO_ACK (3)
           =2 #define ERROR_SCH_WAITING_FOR_START_COMMAND_FROM_MASTER (3)
           =2 
           =2 #define ERROR_SCH_ONE_OR_MORE_SLAVES_DID_NOT_START (4)
           =2 #define ERROR_SCH_LOST_SLAVE (5)
           =2 
           =2 #define ERROR_SCH_CAN_BUS_ERROR (6)
           =2 
           =2 #define ERROR_I2C_WRITE_BYTE (10)
           =2 #define ERROR_I2C_READ_BYTE (11)
           =2 #define ERROR_I2C_WRITE_BYTE_AT24C64 (12)
           =2 #define ERROR_I2C_READ_BYTE_AT24C64 (13)
           =2 #define ERROR_I2C_DS1621 (14)
           =2 
           =2 #define ERROR_USART_TI (21)
           =2 #define ERROR_USART_WRITE_CHAR (22)
           =2 
           =2 #define ERROR_SPI_EXCHANGE_BYTES_TIMEOUT (31)
           =2 #define ERROR_SPI_X25_TIMEOUT (32)
           =2 #define ERROR_SPI_MAX1110_TIMEOUT (33)
           =2 
           =2 #define ERROR_ADC_MAX150_TIMEOUT (44)
           =2 
           =2 #endif
 115      =2  
 116      =2  /*------------------------------------------------------------------*-
 117      =2    ---- END OF FILE -------------------------------------------------
 118      =2  -*------------------------------------------------------------------*/
  25      =1  #include "Sch51.h"
   1      =2  /*------------------------------------------------------------------*-
   2      =2    
   3      =2     SCH51.H (v1.00)
   4      =2  
   5      =2    ------------------------------------------------------------------
   6      =2  
   7      =2     - see SCH51.C for details
   8      =2  
   9      =2  
  10      =2     COPYRIGHT
  11      =2     ---------
  12      =2  
  13      =2     This code is from the book:
  14      =2  
  15      =2     PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont 
  16      =2     [Pearson Education, 2001; ISBN: 0-201-33138-1].
  17      =2  
  18      =2     This code is copyright (c) 2001 by Michael J. Pont.
  19      =2   
  20      =2     See book for copyright details and other information.
  21      =2  
C51 COMPILER V7.06   MAIN                                                                  12/25/2007 19:33:30 PAGE 10  

  22      =2  -*------------------------------------------------------------------*/
  23      =2  
  24      =2  #ifndef _SCH51_H
  25      =2  #define _SCH51_H
  26      =2  
  27      =2  #include "Main.h"
   1      =3  /*------------------------------------------------------------------*-
   2      =3  
   3      =3     Main.H (v1.00)
   4      =3  
   5      =3    ------------------------------------------------------------------
   6      =3     
   7      =3     'Project Header' (see Chap 9) for project SCU_Cb (see Chap 27)
   8      =3  
   9      =3  
  10      =3     COPYRIGHT
  11      =3     ---------
  12      =3  
  13      =3     This code is from the book:
  14      =3  
  15      =3     PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont 
  16      =3     [Pearson Education, 2001; ISBN: 0-201-33138-1].
  17      =3  
  18      =3     This code is copyright (c) 2001 by Michael J. Pont.
  19      =3   
  20      =3     See book for copyright details and other information.
  21      =3  
  22      =3  -*------------------------------------------------------------------*/
  23      =3  
  24      =3  #ifndef _MAIN_H
           =3 #define _MAIN_H
           =3 
           =3 //------------------------------------------------------------------
           =3 // WILL NEED TO EDIT THIS SECTION FOR EVERY PROJECT
           =3 //------------------------------------------------------------------
           =3 
           =3 // Must include the appropriate microcontroller header file here
           =3 #include <reg515c.h>
           =3 
           =3 // Include oscillator / chip details here 
           =3 // (essential if generic delays / timeouts are used)
           =3 //  -
           =3 // Oscillator / resonator frequency (in Hz) e.g. (11059200UL)
           =3 #define OSC_FREQ (10000000UL)
           =3 
           =3 // Number of oscillations per instruction (4, 6 or 12)
           =3 // 12 - Original 8051 / 8052 and numerous modern versions
           =3 //  6 - Various Infineon and Philips devices, etc.
           =3 //  4 - Dallas, etc.
           =3 //
           =3 // Take care with Dallas devices 
           =3 // - Timers default to *12* osc ticks unless CKCON is modified 
           =3 // - If using generic code on a Dallas device, use 12 here
           =3 #define OSC_PER_INST (6)
           =3 
           =3 //------------------------------------------------------------------
           =3 // SHOULD NOT NEED TO EDIT THE SECTIONS BELOW
           =3 //------------------------------------------------------------------
           =3 typedef unsigned char tByte;
           =3 typedef unsigned int  tWord;
           =3 typedef unsigned long tLong;
           =3 
C51 COMPILER V7.06   MAIN                                                                  12/25/2007 19:33:30 PAGE 11  

           =3 // Misc #defines
           =3 #ifndef TRUE
           =3 #define FALSE 0
           =3 #define TRUE (!FALSE)
           =3 #endif
           =3 
           =3 #define RETURN_NORMAL (bit) 0
           =3 #define RETURN_ERROR (bit) 1
           =3 
           =3 
           =3 //------------------------------------------------------------------
           =3 // Interrupts
           =3 // - see Chapter 13.  
           =3 //------------------------------------------------------------------
           =3 
           =3 // Generic 8051/52 timer interrupts (used in most schedulers)
           =3 #define INTERRUPT_Timer_0_Overflow 1
           =3 #define INTERRUPT_Timer_1_Overflow 3
           =3 #define INTERRUPT_Timer_2_Overflow 5
           =3 
           =3 // Additional interrupts (used in shared-clock schedulers)
           =3 #define INTERRUPT_EXTERNAL_0 0
           =3 #define INTERRUPT_EXTERNAL_1 2
           =3 #define INTERRUPT_UART_Rx_Tx 4
           =3 #define INTERRUPT_CAN_c515c 17
           =3 
           =3 //------------------------------------------------------------------
           =3 // Error codes 

⌨️ 快捷键说明

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