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

📄 os_cfg.h

📁 时间触发式51单片机嵌入式多任务系统
💻 H
字号:
/*------------------------------------------------------------------*-

   OS_cfg.H (v1.01)

  ------------------------------------------------------------------

   'Project Header' (see Chap 9) for project IO_T2_T1 (see Chap 18)


   COPYRIGHT
   ---------

   This code is from the book:

   PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont
   [Pearson Education, 2001; ISBN: 0-201-33138-1].

   This code is copyright (c) 2001 by Michael J. Pont.

   See book for copyright details and other information.

-*------------------------------------------------------------------*/

#ifndef _OS_CFG_H
#define _OS_CFG_H


//------------------------------------------------------------------
// SHOULD NOT NEED TO EDIT THE SECTIONS BELOW
//------------------------------------------------------------------

#define RETURN_NORMAL (bit) 0
#define RETURN_ERROR  (bit) 1

//------------------------------------------------------------------
// Error codes
// - see Chapter 14.
//------------------------------------------------------------------

#define ERROR_SCH_TOO_MANY_TASKS                            (1)
#define ERROR_SCH_CANNOT_DELETE_TASK                        (2)

#define ERROR_SCH_WAITING_FOR_SLAVE_TO_ACK                  (3)
#define ERROR_SCH_WAITING_FOR_START_COMMAND_FROM_MASTER     (3)

#define ERROR_SCH_ONE_OR_MORE_SLAVES_DID_NOT_START          (4)
#define ERROR_SCH_LOST_SLAVE                                (5)

#define ERROR_SCH_CAN_BUS_ERROR                             (6)

#define ERROR_I2C_WRITE_BYTE                                (10)
#define ERROR_I2C_READ_BYTE                                 (11)
#define ERROR_I2C_WRITE_BYTE_AT24C64                        (12)
#define ERROR_I2C_READ_BYTE_AT24C64                         (13)
#define ERROR_I2C_DS1621                                    (14)

#define ERROR_USART_TI                                      (21)
#define ERROR_USART_WRITE_CHAR                              (22)

#define ERROR_SPI_EXCHANGE_BYTES_TIMEOUT                    (31)
#define ERROR_SPI_X25_TIMEOUT                               (32)
#define ERROR_SPI_MAX1110_TIMEOUT                           (33)

#define ERROR_ADC_MAX150_TIMEOUT                            (44)

#define ERROR_PARAM                                         (0xf0)

//------------------------------------------------------------------
// System Config
//------------------------------------------------------------------
#define _OS_DISPATCH_TASK           1       // 
#define _OS_ADD_TASK                1       // 
#define _OS_DELETE_TASK             1       // 
#define _OS_REPORT_ERRORS           0       // Incluse code for Output Error Code
#define _OS_CHANGE_REP_TASK         0       // 
#define _OS_CTXSW_TASK              1       // 
#define _OS_TICK_TIMER              0       // use system Timer0=0,Timer1=1,Timer2=2

#define _OS_INICHE_TIMERS           1       // Include code for use in timer count

#define _OS_USER_TICK_TIMER    	    0       // Include code for UserTickTimer()

#if _OS_USER_TICK_TIMER > 0
#define UserTickTimer()                     // 系统定时中断中调用的用户函数
#endif

#define _DELAY_T0_                  0       // 使用软延时
#endif

/*------------------------------------------------------------------*-
  ---- END OF FILE -------------------------------------------------
-*------------------------------------------------------------------*/

⌨️ 快捷键说明

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