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

📄 salvo.h

📁 嵌入式操作系统Salvo 在单片机C8051F350上的移植
💻 H
📖 第 1 页 / 共 5 页
字号:
/************************************************************ 
The contents of this file are subject to the Pumpkin Salvo
License (the "License").  You may not use this file except
in compliance with the License. You may obtain a copy of
the License at http://www.pumpkininc.com, or from
warranty@pumpkininc.com.

Software distributed under the License is distributed on an
"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
or implied. See the License for specific language governing
the warranty and the rights and limitations under the
License.

The Original Code is Salvo - The RTOS that runs in tiny
places(TM). Copyright (C) 1995-2002 Pumpkin, Inc. and its
Licensor(s). All Rights Reserved.

$Source: C:\\RCS\\d\\salvo\\inc\\salvo.h,v $
$Author: aek $
$Revision: 3.77 $
$Date: 2003-07-24 15:18:11-07 $

Primary Salvo header file. 

************************************************************/

#if !defined(__SALVO_H) 
#define __SALVO_H
 

/************************************************************
****                                                     ****
**                                                         **
Version number. Externally (i.e. in an installer's name),
the strings look like:

            Major release:               2.2.0
            Major release, patched:      2.2.0-c
            Beta release:                2.3.0-beta1
    
**                                                         **
****                                                     ****
************************************************************/
#define OSVER_MAJOR             3
#define OSVER_MINOR             2
#define OSVER_SUBMINOR          2
                                
#define OSVERSION               ( OSVER_MAJOR*100 \
                                + OSVER_MINOR*10  \
                                + OSVER_SUBMINOR )
#define OSVersion()             OSVERSION      

                       
/************************************************************
****                                                     ****
**                                                         **
#defines for use in salvocfg.h.

Salvocfg.h contains user-definable SALVO configurations.

**                                                         **
****                                                     ****
************************************************************/
#define FALSE                   0
#define TRUE                    (!FALSE)  

#define OSUNDEF                 0   /* generic const       */
#define OSNONE                  0   /*  ""                 */

#define OSA                     1   /* letter codes used   */
#define OSB                     2   /*  with libraries     */
#define OSC                     3   /*  etc.               */
#define OSD                     4   /*  ""                 */
#define OSE                     5   /*  ""                 */
#define OSF                     6   /*  ""                 */
#define OSG                     7   /*  ""                 */
#define OSH                     8   /*  ""                 */
#define OSI                     9   /*  ""                 */
#define OSJ                     10  /*  ""                 */
#define OSK                     11  /*  ""                 */
#define OSL                     12  /*  ""                 */
#define OSM                     13  /*  ""                 */
#define OSN                     14  /*  ""                 */
#define OSO                     15  /*  ""                 */
#define OSP                     16  /*  ""                 */
#define OSQ                     17  /*  ""                 */
#define OSR                     18  /*  ""                 */
#define OSS                     19  /*  ""                 */
#define OST                     20  /*  ""                 */
#define OSU                     21  /*  ""                 */
#define OSV                     22  /*  ""                 */
#define OSW                     23  /*  ""                 */
#define OSX                     24  /*  ""                 */
#define OSY                     25  /*  ""                 */
#define OSZ                     26  /*  ""                 */

                                    /* for OSLOGGING       */
#define OSLOG_NONE              0   /* no messages at all  */
#define OSLOG_ERRORS            1   /* error messages only */
#define OSLOG_WARNINGS          2   /* warn & err messages */
#define OSLOG_ALL               3   /* all messages        */
                                                                    
                                    /* for OSTARGET        */
#define OSPIC12                 1   /* Microchip PIC12     */
#define OSPIC16                 2   /* Microchip PIC16     */
#define OSPIC17                 3   /* Microchip PIC17     */
#define OSPIC18                 4   /* Microchip PIC18     */
#define OSIX86                  5   /* Intel x86           */
#define OSI8051                 6   /* Intel MCS-51        */
#define OSVAV8                  7   /* VAutomation V8-uRISC*/
#define OSM68HC11               8   /* Motorola 68HC11     */
#define OSMSP430                9   /* TI MSP430 series    */
#define OSM68HC12               10  /* Motorola 68HC12     */
#define OSM68HC08               11  /* Motorola 68HC08     */
#define OSEZ8                   12  /* Zilog Z8 Enhanced   */
#define OSTMS320C28X            13  /* TI TMS DSP '28x     */
#define OSAVR                   14  /* Atmel's AVR family  */
#define OSTMS320C24X            15  /* TI TMS DSP '24x     */
#define OSDSP56800				16  /* Moto DSP56800       */

                                    /* for OSCOMPILER      */
#define OSHT_PICC               1   /* HI-TECH PICC, PICC-18*/
#define OSMW_CW                 2   /* Metrowerks CodeWarrior*/
#define OSMIX_PC                3   /* Mix Power C         */
#define OSIAR_ICC               4   /* IAR C               */
#define OSMPLAB_C17             5   /* Microchip MPLAB C-17*/
#define OSMPLAB_C18             6   /* Microchip MPLAB C-18*/
#define OSHT_8051C              7   /* HI-TECH 8051C       */
#define OSHT_V8C                8   /* HI-TECH V8C         */
#define OSGCC                   9   /* GNU C               */
#define OSKEIL_C51              10  /* Keil C51            */
#define OSTASKING_CC51          11  /* TASKING CC51        */
#define OSAQ_430                12  /* Quadravox 430       */
#define OSIMAGECRAFT            13  /* ImageCraft C        */
#define OSZILOG_ZDSII           14  /* Zilog ZDS II        */
#define OSTI_DSP_CCS            15  /* TI Code Composer Studio */
#define OSRA_CROSSSTUDIO        16  /* Rowley Assoc. CS    */
#define OSMW_56800              17  /* MW for 56800        */
#define OSHPIT_CVAVR			18	/* HP InfoTech CodeVision AVR */
#define OSAVR_GCC				19  /* AVR GCC             */
#define OSGCC_AVR				OSAVR_GCC 

                                    /* abbreviations       */
#define OSFROM_ANYWHERE         OSA /* fns called from anywhere*/
#define OSFROM_BACKGROUND       OSB /* fns called normally */
#define OSFROM_TASK_ONLY        OSFROM_BACKGROUND
#define OSFROM_FOREGROUND       OSF /* fns called from ISRs only*/
#define OSFROM_ISR_ONLY         OSFROM_FOREGROUND


                                    /* OSCTXSW_METHOD      */
#define OSVIA_OSCTXSW           1   /* ctxSw via OSCtxSw() */
#define OSRTNADDR_IS_PARAM      2   /* OSrtnAddr is a param*/
#define OSRTNADDR_IS_VAR        3   /* OSrtnAddr is a var  */
#define OSVIA_OSDISPATCH        4   /* ctxSw via OSCtxSw() */
                                    /*  and use OSDispatch() */ 
#define OSVIA_OSDISPATCH_WLABEL 5   /* OSDispatch()+label  */                                                                    
                                    

/************************************************************
****                                                     ****
**                                                         **
Auto-detect compiler in use, set OSCOMPILER and OSTARGET
accordingly. 

Can be overriden for testing purposes by forcing to OSUNDEF 
or a defined compiler in salvocfg.h (below).

**                                                         **
****                                                     ****
************************************************************/

/* GNU C Compiler (gcc) */
#if   defined(__GNUC__)
#undef  OSCOMPILER
#undef  OSTARGET

#if  defined(__AVR__)
#define OSCOMPILER                      OSGCC_AVR
#define OSTARGET                        OSAVR
#else
#define OSCOMPILER                      OSGCC
#define OSTARGET                        OSIX86
#endif


/* HI-TECH compilers */
#elif defined(HI_TECH_C)
#undef  OSCOMPILER
#undef  OSTARGET
#if   defined(_PIC12)
#define OSCOMPILER                      OSHT_PICC
#define OSTARGET                        OSPIC12
#elif defined(_PIC14)
#define OSCOMPILER                      OSHT_PICC
#define OSTARGET                        OSPIC16
#elif defined(_PIC16)
#define OSCOMPILER                      OSHT_PICC
#define OSTARGET                        OSPIC17
#elif defined(_PIC18)
#define OSCOMPILER                      OSHT_PICC
#define OSTARGET                        OSPIC18
#elif defined(i8051)
#define OSCOMPILER                      OSHT_8051C
#define OSTARGET                        OSI8051
#elif defined(_V8)
#define OSCOMPILER                      OSHT_V8C
#define OSTARGET                        OSVAV8
#endif /* if .. elif .. */


/* V8C v7.85PL1 failed to define HI_TECH_C */
#elif !defined(HI_TECH_C) && defined(_V8) 
#error salvo.h: V8C v7.85PL1 or higher required -- aborting.


/* IAR AVR, MSP430 and PIC18 compilers */                                   
#elif defined(__IAR_SYSTEMS_ICC__) 
#if defined(OSCOMPILER)
#undef  OSCOMPILER
#endif
#if defined(OSTARGET)
#undef  OSTARGET
#endif

#define OSCOMPILER                      OSIAR_ICC
#if   ((__TID__ >> 8) & 0x7F) == 0x31
#define OSTARGET                        OSPIC18
#elif ((__TID__ >> 8) & 0x7F) == 43
#define OSTARGET                        OSMSP430
#elif ((__TID__ >> 8) & 0x7F) == 0x5A
#define OSTARGET                        OSAVR
#endif        
  
/* Keil Cx51 compiler */
#elif defined(__C51__) || defined(__CX51__)
#undef  OSCOMPILER
#undef  OSTARGET
#define OSCOMPILER                      OSKEIL_C51
#define OSTARGET                        OSI8051


/* Metrowerks x86 compiler */
#elif defined(__MWERKS__)
#undef  OSCOMPILER
#undef  OSTARGET
#define OSCOMPILER                      OSMW_CW
#define OSTARGET                        OSIX86


/* Microchip MPLAB-C18 compiler */                                        
#elif defined(__18CXX)
#undef  OSCOMPILER
#undef  OSTARGET
#define OSCOMPILER                      OSMPLAB_C18
#define OSTARGET                        OSPIC18


/* TASKING CC51 compiler */
#elif defined(_CC51)
#undef  OSCOMPILER
#undef  OSTARGET
#define OSCOMPILER                      OSTASKING_CC51
#define OSTARGET                        OSI8051


/* Archelon / Quadravox 430 compiler */
#elif defined(__ARCHELON__) || defined(__AQCOMPILER__)
#undef  OSCOMPILER
#undef  OSTARGET
#define OSCOMPILER                      OSAQ_430
#define OSTARGET                        OSMSP430


/* ImageCraft compilers */
#elif defined(__IMAGECRAFT__)
#undef  OSCOMPILER
#define OSCOMPILER                      OSIMAGECRAFT
#undef  OSTARGET
#if   defined(_HC11)
#define OSTARGET                        OSM68HC11
#elif defined(_MSP430)
#define OSTARGET                        OSMSP430
#elif defined(_AVR)
#define OSTARGET                        OSAVR
#else
#error salvo.h: Unknown target for ImageCraft ICC. 
#endif


/* TI's DSP Code Composer for TMS320C24x|28x */
#elif defined(_TMS320C2XX) || defined(__TMS320C28XX__)
#undef  OSCOMPILER
#define OSCOMPILER                      OSTI_DSP_CCS
#undef  OSTARGET
#if   defined(_TMS320C2XX)
#define OSTARGET                        OSTMS320C24X
#elif defined(__TMS320C28XX__)
#define OSTARGET                        OSTMS320C28X
#else
#error salvo.h: Unknown target for TI DSP CCS.
#endif


/* Rowley Associates' CrossWorks MSP430 */
#elif defined(__CROSSWORKS_MSP430)
#undef  OSCOMPILER
#undef  OSTARGET
#define OSCOMPILER                      OSRA_CROSSSTUDIO
#define OSTARGET                        OSMSP430


#endif /* #if defined(__GNUC__) #elif ... */


/************************************************************
****                                                     ****
**                                                         **
Include appropriate header files.

If generating a library, no settings should be overridden.
Otherwise include salvocfg.h. OSMAKE_LIBRARY is expected to
be defined outside of source files, e.g. on the compiler's
command-line.

salvocfg.h can override (if desired) certain settings in 
salvolib.h.

**                                                         **
****                                                     ****
************************************************************/

/* set to FALSE if not defined externally. */
#if !defined(OSMAKE_LIBRARY)
#define OSMAKE_LIBRARY                  FALSE
#endif

/* if TRUE, we're doing a library build, and so salvocfg.h */
/*  is disregarded -- we use salvolib.h in its place.      */
#if OSMAKE_LIBRARY
#include <salvolib.h>
#else
#include "salvocfg.h"

/* in case we picked up the user's salvocfg.h, we'll need  */
/*  to define this symbol if it's undefined.               */
#if !defined(OSUSE_LIBRARY)
#define OSUSE_LIBRARY                   FALSE
#endif
                                        
/* to get here, we have a user wanting to build an app by  */
/*  linking to libraries.                                  */
#if OSUSE_LIBRARY
#include <salvolib.h> 
#endif
#endif


/************************************************************
****                                                     ****
**                                                         **
macro to make / concatenate strings -- used in several
portXyz.h files, so define it now.

**                                                         **
****                                                     ****
************************************************************/
#define _OSMkstr(a)                     #a


/************************************************************
****                                                     ****
**                                                         **
Compiler- and/or target-specific configuration options.

**                                                         **
****                                                     ****
************************************************************/
#if !defined(OSIAR_PIC18_ATTR_ALL)
#define OSIAR_PIC18_ATTR_ALL                /* i.e. no attribute */
#endif


#if !defined(OSMPLAB_C18_LOC_ALL_NEAR)
#define OSMPLAB_C18_LOC_ALL_NEAR        FALSE
#endif


#if !defined(OSMPLAB_C18_STACK_SIZE)
#define OSMPLAB_C18_STACK_SIZE          512  /* will work for any stack size */
#endif
      
                                       
#if !defined(OSPIC18_INTERRUPT_MASK)
#define OSPIC18_INTERRUPT_MASK          0xC0 /* disable both GIE/GIEH and PEIE/GIEL */
#endif


/************************************************************
****                                                     ****
**                                                         **
General configuration options.

⌨️ 快捷键说明

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