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

📄 os.h

📁 《OSEK/VDX汽车电子嵌入式软件编程技术》中光盘的资料
💻 H
字号:
/************************************************
*
*	$Copyright    2001 Joseph J. Lemieux  ALL RIGHTS RESERVED. $
*
*	$Filename: C:\OSEKBook\src\CH09\inc\OS.H $
*
*	Description:	OS Include file that encapsulates
*                   the OS specific header files.
*
************************************************/
#ifndef OSH
#define OSH


/***********************************************
*
*    OSEKWorks specific header files.
*
*	osekworks.h - OS specific definitions.
*	osekworkscom.h - COM specific definitions.
*	osekworksnm.h - NM specific definitions.
*	oil.h - Application specific definitions generated
*            from the OIL file.
*
***********************************************/
#include "osekworks.h"
#include "osekworkscom.h"
#include "oil.h"
//#include "init.h"

#define ALL_INTERRUPTS 1
#define INTERRUPT

#define InitCOM()
#define CloseCOM()
/*********************
*
*   Application Mode conversion Definition Macros
*   Used in os.cfg to define conversions. See
*   .cfg file for usage description.
*
*********************/

typedef enum ConvertAppModeTypetag {
   APP_MODE_MASK,
   APP_MODE_VALUE
}ConvertAppModeType;

/*********************
*
*   Application Mode conversion Table
*
*********************/
typedef struct ConvertAppModeListTypetag {
   AppModeType mode;
   UINT8 value;
   }ConvertAppModeListType;


/*********************
*
*   Define Configuration Macros
*   
*   This section defines the configuration macros
*   and includes the configuration file to configure
*   the application mode conversion list.
*
*********************/

#define START_APPMODE_CONVERT_LIST(name,size) \
enum ConvertAppModeValueEnum {
#define ADD_APPMODE_CONVERT_LIST(appmode) \
   appmode##_VALUE,
#define END_APPMODE_CONVERT_LIST \
   INVALID_APPMODE_VALUE};
#include "os.cfg"

#undef START_APPMODE_CONVERT_LIST
#undef ADD_APPMODE_CONVERT_LIST
#undef END_APPMODE_CONVERT_LIST
#undef OSCFG
#define START_APPMODE_CONVERT_LIST(name,size) \
enum ConvertAppModeMaskEnum {
#define ADD_APPMODE_CONVERT_LIST(appmode) \
   appmode##_MASK = 1 << appmode##_VALUE,
#define END_APPMODE_CONVERT_LIST \
   INVALID_APPMODE_MASK = 0xFFFFFFFF};
#include "os.cfg"

#undef START_APPMODE_CONVERT_LIST
#undef ADD_APPMODE_CONVERT_LIST
#undef END_APPMODE_CONVERT_LIST
#undef OSCFG

#ifdef OSC
#define START_APPMODE_CONVERT_LIST(name,size) \
   ConvertAppModeListType const name[size+1] = {
#define ADD_APPMODE_CONVERT_LIST(appmode) \
   {(AppModeType)appmode,appmode##_VALUE},
#define END_APPMODE_CONVERT_LIST \
   (AppModeType)0,0xFF};

#else

#define START_APPMODE_CONVERT_LIST(name,size) \
extern ConvertAppModeListType const name[size+1];
#define ADD_APPMODE_CONVERT_LIST(appmode)
#define END_APPMODE_CONVERT_LIST

#endif /* OSC */

/************************************************
*
*   Function:     DisableAllInterrupts
*
*   Inputs:       void
*
*   Outputs:      Stores last in array for nesting.
*
*   Returns:      void
*
*   Description:  Nesting of interrupts is not allowed at this
*                 time in the specification.
*
************************************************/
void DisableAllInterrupts(void);
/************************************************
*
*   Function:     EnableAllInterrupts
*
*   Inputs:       void
*
*   Outputs:      Restores last from array in nesting.
*
*   Returns:      void
*
*   Description:  Allows enabling of interrupts to state
*                 prior to the DisableAllInterrupts call.
*
************************************************/
void EnableAllInterrupts(void);

#define SuspendOSInterrupts() DisableAllInterrupts()
#define ResumeOSInterrupts() EnableAllInterrupts()

#include "os.cfg"

#endif /* OSH */

⌨️ 快捷键说明

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