/************************************************************
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-2006 Pumpkin, Inc. and its
Licensor(s). All Rights Reserved.

$Source: C:\\RCS\\D\\Pumpkin\\Salvo\\inc\\salvolib.h,v $
$Author: aek $
$Revision: 3.64 $
$Date: 2006-05-15 19:27:11-07 $

Salvo configuration file for generating and using freeware
and standard libraries.

NOTE:      This file is used in place of salvocfg.h when
         building libraries.

WARNING:   Users -- DO NOT EDIT THIS FILE! To build your
         own custom libraries from the supplied libraries,
         please see the end of this file.

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


#if   (OSCOMPILER == OSHT_PICC)   \
  ||  (OSCOMPILER == OSHT_430C)   \
  ||  (OSCOMPILER == OSHT_V8C)    \
  ||  (OSCOMPILER == OSHT_8051C)  \
  ||  (OSCOMPILER == OSGCC)       \
  ||  (OSCOMPILER == OSKEIL_C51)  \
  ||  (OSCOMPILER == OSKEIL_CARM) \
  ||  (OSCOMPILER == OSGCC_ARM)   \
  ||  (OSCOMPILER == OSMPLAB_C30) \
  ||  (OSCOMPILER == OSMW_CW)     \
  ||  (OSCOMPILER == OSMPLAB_C18) \
  ||  (OSCOMPILER == OSAQ_430)    \
  ||  (OSCOMPILER == OSGCC_AVR)   \
  || ((OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSARM7)      ) \
  || ((OSCOMPILER == OSARM_RVDS)       && (OSTARGET == OSARMCM3)    ) \
  || ((OSCOMPILER == OSGCC_CM3)        && (OSTARGET == OSARMCM3)    ) \
  || ((OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSAVR)       ) \
  || ((OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSMSP430)    ) \
  || ((OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSPIC18)     ) \
  || ((OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSARM7)      ) \
  || ((OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSAVR)       ) \
  || ((OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSM68HC11)   ) \
  || ((OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSMSP430)    ) \
  || ((OSCOMPILER == OSRA_CROSSSTUDIO) && (OSTARGET == OSMSP430)    ) \
  || ((OSCOMPILER == OSZILOG_ZDSII)    && (OSTARGET == OSEZ8)       ) \
  || ((OSCOMPILER == OSTI_DSP_CCS)     && (OSTARGET == OSTMS320C24X)) \
  || ((OSCOMPILER == OSTI_DSP_CCS)     && (OSTARGET == OSTMS320C28X))


//#error salvolib.h: compiler:OSCOMPILER target:OSTARGET
//#error salvolib.h: type:OSLIBRARY_TYPE config:OSLIBRARY_CONFIG

/************************************************************/
/************************************************************/
/*                                                          */
/* pick up these config options from command line:          */
/*        OSMAKE_LIBRARY:    TRUE if generating library     */
/*        OSLIBRARY_TYPE:    library-dependent              */
/*        OSLIBRARY_CONFIG:  library-dependent              */
/*        OSLIBRARY_VARIANT: library-dependent              */
/*                                                          */
/*                                                          */
/* when _building_ libraries, we need to pick up the        */
/*  generic header file. When _using_ libraries, the user   */
/*  must #include the target-specific header file in the    */
/*  project's salvocfg.h. (Not always true ...)             */
/*                                                          */
#if OSMAKE_LIBRARY

#undef  OSUSE_LIBRARY
#define OSUSE_LIBRARY                   FALSE

/* non-Win32 compilers need / use shorter command lines ... */
#if  (OSCOMPILER == OSHT_V8C)
#define OSLIBRARY_TYPE                  OSL_T
#define OSLIBRARY_GLOBALS               OSL_G
#define OSLIBRARY_CONFIG                OSL_C
#define OSLIBRARY_VARIANT               OSL_V
#define OSCUSTOM_LIBRARY_CONFIG			OSCLC
#endif

#endif /* #if OSMAKE_LIBRARY */

/************************************************************/
/************************************************************/
/*                                                          */
/* many compiler & target combos do not have variants       */
/*                                                          */
#if   (OSCOMPILER == OSAQ_430) \
 ||   (OSCOMPILER == OSHT_430C) \
 ||   (OSCOMPILER == OSMPLAB_C18) \
 ||   (OSCOMPILER == OSKEIL_CARM) \
 ||   (OSCOMPILER == OSGCC_ARM)   \
 ||   (OSCOMPILER == OSMPLAB_C30)   \
 || ( (OSCOMPILER == OSGCC_AVR) )                                      \
 || ( (OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSARM7)       ) \
 || ( (OSCOMPILER == OSARM_RVDS)       && (OSTARGET == OSARMCM3)     ) \
 || ( (OSCOMPILER == OSGCC_CM3)        && (OSTARGET == OSARMCM3)     ) \
 || ( (OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSAVR)        ) \
 || ( (OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSMSP430)     ) \
 || ( (OSCOMPILER == OSIAR_ICC)        && (OSTARGET == OSPIC18)      ) \
 || ( (OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSARM7)       ) \
 || ( (OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSAVR)        ) \
 || ( (OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSM68HC11)    ) \
 || ( (OSCOMPILER == OSIMAGECRAFT)     && (OSTARGET == OSMSP430)     ) \
 || ( (OSCOMPILER == OSRA_CROSSSTUDIO) && (OSTARGET == OSMSP430)     ) \
 || ( (OSCOMPILER == OSTI_DSP_CCS)     && (OSTARGET == OSTMS320C24X) ) \
 || ( (OSCOMPILER == OSTI_DSP_CCS)     && (OSTARGET == OSTMS320C28X) ) \
 || ( (OSCOMPILER == OSZILOG_ZDSII)    && (OSTARGET == OSEZ8)        )
#if defined(OSLIBRARY_VARIANT)
#undef  OSLIBRARY_VARIANT
#endif
#define OSLIBRARY_VARIANT                OSNONE
#endif


/************************************************************/
/************************************************************/
/*                                                          */
/* ensure configuration options are specified, either from  */
/*  above (when generating) or when using the library.      */
/*                                                          */
#if !defined(OSUSE_LIBRARY)
#error salvolib.h: Library generate/use not specified -- aborting.
#endif

#if !defined(OSLIBRARY_TYPE)
#error salvolib.h: Library type not specified -- aborting.
#endif

#if !defined(OSLIBRARY_CONFIG)
#error salvolib.h: Library configuration not specified -- aborting.
#endif

#if !defined(OSLIBRARY_VARIANT)
#error salvolib.h: Library variant not specified -- aborting.
#endif

#if     (OSCOMPILER == OSKEIL_C51) \
   ||   (OSCOMPILER == OSMPLAB_C18) \
   ||   (OSCOMPILER == OSHT_8051C) \
   || ( (OSCOMPILER == OSIAR_ICC) && (OSTARGET == OSPIC18) )
#if !defined(OSLIBRARY_GLOBALS)
#error salvolib.h: Library memory type for globals not specified -- aborting.
#endif
#endif



/************************************************************/
/************************************************************/
/*                                                          */
/* common across all libraries                              */
/*                                                          */
#define OSCOMBINE_EVENT_SERVICES        FALSE
#define OSENABLE_EVENT_TRYING           TRUE


/************************************************************/
/************************************************************/
/*                                                          */
/* Set configuration options based on OSLIBRARY_TYPE,       */
/*  OSLIBRARY_CONFIG and OSLIBRARY_VARIANT.                 */
/*                                                          */

/************************************************************/
/*                                                          */
/* OSLIBRARY_TYPE settings -- types differ by limits only   */
/*  freeware libraries have set limits. Since SE libraries  */
/*  have limits that exceed the defaults, a special check   */
/*  is required for them, whereas none is required for tiny,*/
/*  LE and Pro libs (unlimited).                            */
/*                                                          */
/* All libraries are built with the same size mem.o object. */
/*                                                          */
#if   (OSLIBRARY_TYPE == OSF)

#define OSSET_LIMITS                    TRUE


#elif (OSLIBRARY_TYPE == OSL)

#if   (OSLIBRARY_CONFIG == OSS)
#define OSSET_LIMITS                    TRUE
#else
#define OSSET_LIMITS                    FALSE
#endif

#else

#error salvolib.h: Unknown library type -- aborting.

#endif


/************************************************************/
/*                                                          */
/* OSLIBRARY_CONFIG settings --                             */
/*                                                          */
/*                                                          */
/* multitasking-with-delays-and-events libraries            */
/*                                                          */
#if   (OSLIBRARY_CONFIG == OSA)

#define OSBYTES_OF_DELAYS               1
#define OSBYTES_OF_TICKS                4
#define OSDISABLE_TASK_PRIORITIES       FALSE
#define OSENABLE_BINARY_SEMAPHORES      TRUE
#define OSENABLE_CYCLIC_TIMERS          FALSE
#define OSENABLE_EVENT_FLAGS            TRUE
#define OSENABLE_IDLING_HOOK            TRUE
#define OSENABLE_MESSAGES               TRUE
#define OSENABLE_MESSAGE_QUEUES         TRUE
#define OSENABLE_SEMAPHORES             TRUE
#define OSENABLE_TIMEOUTS               FALSE


/*                                                          */
/* multitasking-with-delays libraries                       */
/*                                                          */
#elif (OSLIBRARY_CONFIG == OSD)

#define OSBYTES_OF_DELAYS               1
#define OSBYTES_OF_TICKS                4
#define OSDISABLE_TASK_PRIORITIES       FALSE
#define OSENABLE_BINARY_SEMAPHORES      FALSE
#define OSENABLE_CYCLIC_TIMERS          FALSE
#define OSENABLE_EVENT_FLAGS            FALSE
#define OSENABLE_IDLING_HOOK            TRUE
#define OSENABLE_MESSAGES               FALSE
#define OSENABLE_MESSAGE_QUEUES         FALSE
#define OSENABLE_SEMAPHORES             FALSE
#define OSENABLE_TIMEOUTS               FALSE


/*                                                          */
/* multitasking-with-events libraries                       */
/*                                                          */
#elif (OSLIBRARY_CONFIG == OSE)

#define OSBYTES_OF_DELAYS               0
#define OSBYTES_OF_TICKS                4
#define OSDISABLE_TASK_PRIORITIES       FALSE
#define OSENABLE_BINARY_SEMAPHORES      TRUE
#define OSENABLE_CYCLIC_TIMERS          FALSE
#define OSENABLE_EVENT_FLAGS            TRUE
#define OSENABLE_IDLING_HOOK            TRUE
#define OSENABLE_MESSAGES               TRUE
#define OSENABLE_MESSAGE_QUEUES         TRUE
#define OSENABLE_SEMAPHORES             TRUE
#define OSENABLE_TIMEOUTS               FALSE


/*                                                          */
/* multitasking-only libraries                              */
/*                                                          */
#elif (OSLIBRARY_CONFIG == OSM)

#define OSBYTES_OF_DELAYS               0
#define OSBYTES_OF_TICKS                4
#define OSDISABLE_TASK_PRIORITIES       TRUE
#define OSENABLE_BINARY_SEMAPHORES      FALSE
#define OSENABLE_CYCLIC_TIMERS          FALSE
#define OSENABLE_EVENT_FLAGS            FALSE
#define OSENABLE_IDLING_HOOK            FALSE
#define OSENABLE_MESSAGES               FALSE
#define OSENABLE_MESSAGE_QUEUES         FALSE
#define OSENABLE_SEMAPHORES             FALSE
#define OSENABLE_TIMEOUTS               FALSE


/*                                                          */
/* SE (bundled-only version) libraries                      */
/*                                                          */
#elif (OSLIBRARY_CONFIG == OSS)

#define OSBYTES_OF_DELAYS               1
#define OSBYTES_OF_TICKS                4
#define OSDISABLE_TASK_PRIORITIES       FALSE
#define OSENABLE_BINARY_SEMAPHORES      TRUE
#define OSENABLE_CYCLIC_TIMERS          FALSE
#define OSENABLE_EVENT_FLAGS            FALSE
#define OSENABLE_IDLING_HOOK            TRUE
#define OSENABLE_MESSAGES               TRUE
#define OSENABLE_MESSAGE_QUEUES         FALSE
#define OSENABLE_SEMAPHORES             TRUE
#define OSENABLE_TIMEOUTS               FALSE


/*                                                          */
/* multitasking-with-delays-and-events-and-timeouts         */
/*  libraries                                               */
/*                                                          */
#elif (OSLIBRARY_CONFIG == OST)

#define OSBYTES_OF_DELAYS               1
#define OSBYTES_OF_TICKS                4
#define OSDISABLE_TASK_PRIORITIES       FALSE
#define OSENABLE_BINARY_SEMAPHORES      TRUE
#define OSENABLE_CYCLIC_TIMERS          TRUE
#define OSENABLE_EVENT_FLAGS            TRUE
#define OSENABLE_IDLING_HOOK            TRUE
#define OSENABLE_MESSAGES               TRUE
#define OSENABLE_MESSAGE_QUEUES         TRUE
#define OSENABLE_SEMAPHORES             TRUE
#define OSENABLE_TIMEOUTS               TRUE

/*                                                          */
/* tiny (bundled-only version) libraries                    */
/*                                                          */
#elif (OSLIBRARY_CONFIG == OSY)

#define OSBYTES_OF_DELAYS               1
#define OSBYTES_OF_TICKS                0
#define OSDISABLE_TASK_PRIORITIES       TRUE
#define OSENABLE_BINARY_SEMAPHORES      TRUE
#define OSENABLE_CYCLIC_TIMERS          FALSE
#define OSENABLE_EVENT_FLAGS            FALSE
#define OSENABLE_IDLING_HOOK            TRUE
#define OSENABLE_MESSAGES               FALSE
#define OSENABLE_MESSAGE_QUEUES         FALSE
#define OSENABLE_SEMAPHORES             TRUE
#define OSENABLE_TIMEOUTS               FALSE


#else

#error salvolib.h: Unknown library configuration -- aborting.

#endif


/************************************************************/
/*                                                          */
/* OSLIBRARY_VARIANT settings --  OSCALL_OSXYZ settings     */
/*                                                          */
#if   (OSLIBRARY_VARIANT == OSA)


#if  (OSCOMPILER == OSHT_PICC) || (OSCOMPILER == OSHT_V8C) \
  || (OSCOMPILER == OSKEIL_C51)

#define OSCALL_OSCREATEEVENT            OSFROM_ANYWHERE
#define OSCALL_OSGETPRIOTASK            OSFROM_ANYWHERE
#define OSCALL_OSGETSTATETASK           OSFROM_ANYWHERE
#define OSCALL_OSMSGQCOUNT              OSFROM_ANYWHERE
#define OSCALL_OSMSGQEMPTY              OSFROM_ANYWHERE
#define OSCALL_OSRETURNEVENT            OSFROM_ANYWHERE
#define OSCALL_OSSIGNALEVENT            OSFROM_ANYWHERE
#define OSCALL_OSSTARTTASK              OSFROM_ANYWHERE

#endif


#elif (OSLIBRARY_VARIANT == OSB)

#if  (OSCOMPILER == OSHT_PICC) || (OSCOMPILER == OSHT_V8C)

#define OSCALL_OSCREATEEVENT            OSFROM_BACKGROUND
#define OSCALL_OSGETPRIOTASK            OSFROM_BACKGROUND
#define OSCALL_OSGETSTATETASK           OSFROM_BACKGROUND
#define OSCALL_OSMSGQCOUNT              OSFROM_BACKGROUND
#define OSCALL_OSMSGQEMPTY              OSFROM_BACKGROUND
#define OSCALL_OSRETURNEVENT            OSFROM_BACKGROUND
#define OSCALL_OSSIGNALEVENT            OSFROM_BACKGROUND
#define OSCALL_OSSTARTTASK              OSFROM_BACKGROUND

#elif (OSCOMPILER == OSKEIL_C51)

#define OSPRESERVE_INTERRUPT_MASK        FALSE

#endif


#elif (OSLIBRARY_VARIANT == OSE)

#if   (OSCOMPILER == OSKEIL_C51)

#define OSPRESERVE_INTERRUPT_MASK        TRUE

#endif


#elif (OSLIBRARY_VARIANT == OSF)

#if  (OSCOMPILER == OSHT_PICC) || (OSCOMPILER == OSHT_V8C)

#define OSCALL_OSCREATEEVENT            OSFROM_FOREGROUND
#define OSCALL_OSGETPRIOTASK            OSFROM_FOREGROUND
#define OSCALL_OSGETSTATETASK           OSFROM_FOREGROUND
#define OSCALL_OSMSGQCOUNT              OSFROM_FOREGROUND
#define OSCALL_OSMSGQEMPTY              OSFROM_FOREGROUND
#define OSCALL_OSRETURNEVENT            OSFROM_FOREGROUND
#define OSCALL_OSSIGNALEVENT            OSFROM_FOREGROUND
#define OSCALL_OSSTARTTASK              OSFROM_FOREGROUND

#endif

#elif (OSLIBRARY_VARIANT == OSI)

/* nothing doing here -- used by IAR MSP430 C compiler, */
/*  among others ...                                    */

#elif (OSLIBRARY_VARIANT != OSNONE)

#error salvolib.h: Unknown library variant -- aborting.

#endif


/************************************************************/
/*                                                          */
/* OSLIBRARY_GLOBALS settings --  compiler-dependent        */
/*                                                          */
#if   (OSCOMPILER == OSMPLAB_C18)
    #if   (OSLIBRARY_GLOBALS == OSN)
    #define OSMPLAB_C18_LOC_ALL_NEAR        TRUE
    #elif (OSLIBRARY_GLOBALS == OSF)
    #define OSMPLAB_C18_LOC_ALL_NEAR        FALSE
    #else
    #error salvolib.h: Unknown library memory type -- aborting.
    #endif /* #if OSLIBRARY_GLOBALS ... */


/* for KC51, there's little point in having message			*/
/*  to data space, so when Salvo's global objects are in	*/
/*  the data space, messages point to the idata space.		*/
#elif (OSCOMPILER == OSKEIL_C51)
    #if   (OSLIBRARY_GLOBALS == OSD)
    #define OSLOC_ALL                        data
    #define OSMESSAGE_TYPE					 idata
    #elif (OSLIBRARY_GLOBALS == OSI)
    #define OSLOC_ALL                        idata
    #define OSMESSAGE_TYPE					 idata
    #elif (OSLIBRARY_GLOBALS == OSX)
    #define OSLOC_ALL                        xdata
    #define OSMESSAGE_TYPE					 xdata
    #else
    #error salvolib.h: Unknown library memory type -- aborting.
    #endif /* #if OSLIBRARY_GLOBALS ... */


#elif (OSCOMPILER == OSHT_8051C)
    #if   (OSLIBRARY_GLOBALS == OSD)
    #define OSLOC_ALL                        near
    #elif (OSLIBRARY_GLOBALS == OSI)
    #define OSLOC_ALL                        idata
    #elif (OSLIBRARY_GLOBALS == OSX)
    #define OSLOC_ALL                        far
    #else
    #error salvolib.h: Unknown library memory type -- aborting.
    #endif /* #if OSLIBRARY_GLOBALS ... */


#elif ( (OSCOMPILER == OSIAR_ICC) && (OSTARGET == OSAVR ) )
    #if   (__MEMORY_MODEL__ == 1)
    #define OSLOC_ALL                        __tiny
    #elif (__MEMORY_MODEL__ == 2)
    #define OSLOC_ALL                        __near
    #elif (__MEMORY_MODEL__ == 3)
    #define OSLOC_ALL                        __far
    #else
    #error salvolib.h: Unknown memory model -- aborting.
    #endif /* #if OSLIBRARY_GLOBALS ... */


#elif ( (OSCOMPILER == OSIAR_ICC) && (OSTARGET == OSPIC18 ) )
    #if   (OSLIBRARY_GLOBALS == OSN)
    #define OSLOC_ALL                        __bank0
    #elif (OSLIBRARY_GLOBALS == OSF)
    #define OSLOC_ALL                        __bank
    #else
    #error salvolib.h: Unknown library memory type -- aborting.
    #endif /* #if OSLIBRARY_GLOBALS ... */

#endif /* #if OSCOMPILER ... */


/************************************************************/
/************************************************************/
/*                                                          */
/* task and event limits for all libraries. These limits    */
/*  have no effect if OSSET_LIMITS is FALSE.                */
/*                                                          */
/* tiny and SE don't support event flags or message queues  */
/*                                                          */
#if (OSTARGET == OSPIC16) \
 || (OSTARGET == OSPIC17) \
 || (OSTARGET == OSPIC18) \
 || (OSTARGET == OSPIC24F) \
 || (OSTARGET == OSPIC24H) \
 || (OSTARGET == OSDSPIC30F) \
 || (OSTARGET == OSDSPIC33F) \
 || (OSTARGET == OSARM7) \
 || (OSTARGET == OSARMCM3) \
 || (OSTARGET == OSVAV8) \
 || (OSTARGET == OSM68HC11) \
 || (OSTARGET == OSI8051) \
 || (OSTARGET == OSAVR) \
 || (OSTARGET == OSMSP430) \
 || (OSTARGET == OSEZ8) \
 || (OSTARGET == OSTMS320C24X) \
 || (OSTARGET == OSTMS320C28X)

#define OSLIBRARY_EVENTS                8
#define OSLIBRARY_TASKS                 4

#if (OSLIBRARY_CONFIG == OSS) \
 || (OSLIBRARY_CONFIG == OSY)
#define OSLIBRARY_EVENT_FLAGS           0
#define OSLIBRARY_MESSAGE_QUEUES        0
#else
#define OSLIBRARY_EVENT_FLAGS           1
#define OSLIBRARY_MESSAGE_QUEUES        1
#endif

#elif (OSTARGET == OSPIC12)

#define OSLIBRARY_EVENTS                4
#define OSLIBRARY_TASKS                 3
#define OSLIBRARY_EVENT_FLAGS           1
#define OSLIBRARY_MESSAGE_QUEUES        0

#elif (OSTARGET == OSIX86)

#define OSLIBRARY_EVENTS                25
#define OSLIBRARY_TASKS                 25
#define OSLIBRARY_EVENT_FLAGS           25
#define OSLIBRARY_MESSAGE_QUEUES        25

#endif

#define OSLIB_SE_EVENTS_LIMIT           12
#define OSLIB_SE_TASKS_LIMIT            7




/************************************************************/
/************************************************************/
/*                                                          */
/* this section differentiates between library generation   */
/*  and library usage (freeware or standard).               */
/*                                                          */
/* library generation -- use maximum allowed                */
/*                                                          */
#if OSMAKE_LIBRARY

#define OSTASKS                         OSLIBRARY_TASKS

#if (OSLIBRARY_CONFIG == OSA) \
 || (OSLIBRARY_CONFIG == OSE) \
 || (OSLIBRARY_CONFIG == OSS) \
 || (OSLIBRARY_CONFIG == OST) \
 || (OSLIBRARY_CONFIG == OSY)

#define OSEVENT_FLAGS                   OSLIBRARY_EVENT_FLAGS
#define OSEVENTS                        OSLIBRARY_EVENTS
#define OSMESSAGE_QUEUES                OSLIBRARY_MESSAGE_QUEUES
#else
#define OSEVENT_FLAGS                   0
#define OSEVENTS                        0
#define OSMESSAGE_QUEUES                0
#endif

/*                                                          */
/* library use -- override up to maximum allowed for        */
/*  freeware libraries, and allow full range of values for  */
/*  standard libraries.                                     */
/*                                                          */
#else /* #if OSMAKE_LIBRARY */


/* if (OSUSE_LIBRARY == TRUE)								*/
/*                                                          */
/* events can be overridden downwards, but not to 0.        */
/* event flags and message queues can be overriden down to  */
/*  0 when these event types aren't used.                   */
/*                                                          */
/* The reason for the lack of default values for OSEVENTS,	*/
/*  OSEVENT_FLAGS and OSMESSAGE_QUEUES is that when users	*/
/*  don't have to explicitly set those values, they end up	*/
/*  using events, event flags and message queues that they	*/
/*  haven't allocated memory to, and since the compiler	    */
/*  cannot generate an error when this occurs, they end up 	*/
/*  with all sorts of weird behavior that is ultimately 	*/
/*  traced to a failure to define these configuration 		*/
/*  options.												*/ 
#if (OSLIBRARY_CONFIG == OSA) \
 || (OSLIBRARY_CONFIG == OSE) \
 || (OSLIBRARY_CONFIG == OSS) \
 || (OSLIBRARY_CONFIG == OST) \
 || (OSLIBRARY_CONFIG == OSY)

#if !defined(OSEVENTS)
//#define OSEVENTS                        OSLIBRARY_EVENTS
#error salvolib.h: salvocfg.h: OSEVENTS undefined -- aborting.
#elif OSEVENTS == 0
#error salvolib.h: Library requires OSEVENTS >= 0 -- aborting.
#elif ( (OSEVENTS > OSLIBRARY_EVENTS) \
     && (OSLIBRARY_TYPE == OSF) )
#error salvolib.h: OSEVENTS exceeds freeware library limit -- aborting.
#elif ( (OSEVENTS > OSLIB_SE_EVENTS_LIMIT) \
     && ( (OSLIBRARY_TYPE == OSL) && (OSLIBRARY_CONFIG == OSS) ) )
#error salvolib.h: OSEVENTS exceeds SE library limit -- aborting.
#endif

/*                                                          */
/* note that these limits (event flags and message queues)  */
/*  are not "hard" in that there is not limit-checking on   */
/*  on particular event types -- only on all events. These  */
/*  limits are here mainly because the Salvo Lite apps would*/
/*  otherwise have too large a default RAM utilization in   */
/*  the mem.c module.                                       */
/*                                                          */
#if !defined(OSEVENT_FLAGS)
//#define OSEVENT_FLAGS                   OSLIBRARY_EVENT_FLAGS
#error salvolib.h: salvocfg.h: OSEVENT_FLAGS undefined -- aborting.
#elif ( (OSEVENT_FLAGS > OSLIBRARY_EVENT_FLAGS) \
     && ( (OSLIBRARY_TYPE == OSF) ) )
#error salvolib.h: OSEVENT_FLAGS exceeds freeware library limit -- aborting.
#endif

#if !defined(OSMESSAGE_QUEUES)
//#define OSMESSAGE_QUEUES                OSLIBRARY_MESSAGE_QUEUES
#error salvolib.h: salvocfg.h: OSMESSAGE_QUEUES undefined -- aborting.
#elif ( (OSMESSAGE_QUEUES > OSLIBRARY_MESSAGE_QUEUES) \
     && ( (OSLIBRARY_TYPE == OSF) ) )
#error salvolib.h: OSMESSAGE_QUEUES exceeds freeware library limit -- aborting.
#endif

#else /* #if (OSLIBRARY_CONFIG ... */

#if !defined(OSEVENTS)
#define OSEVENTS                        0
#elif OSEVENTS > 0
#error salvolib.h: Library incompatible with OSEVENTS > 0 -- aborting.
#endif

#if !defined(OSEVENT_FLAGS)
#define OSEVENT_FLAGS                   0
#elif OSEVENT_FLAGS > 0
#error salvolib.h: Library incompatible with OSEVENT_FLAGS > 0 -- aborting.
#endif

#if !defined(OSMESSAGE_QUEUES)
#define OSMESSAGE_QUEUES                0
#elif OSMESSAGE_QUEUES > 0
#error salvolib.h: Library incompatible with OSMESSAGE_QUEUES > 0 -- aborting.
#endif

#endif /* #if (OSLIBRARY_CONFIG ... */


/*                                                          */
/* tasks can be overridden downwards, but not to 0          */
/*                                                          */
#if !defined(OSTASKS)
//#define OSTASKS                         OSLIBRARY_TASKS
#error salvolib.h: salvocfg.h: OSTASKS undefined -- aborting.
#elif OSTASKS == 0
#error salvolib.h: Library requires OSTASKS >= 0 -- aborting.
#elif ( (OSTASKS > OSLIBRARY_TASKS) \
     && ( (OSLIBRARY_TYPE == OSF) ) )
#error salvolib.h: OSTASKS exceeds freeware library limit -- aborting.
#elif ( (OSTASKS > OSLIB_SE_TASKS_LIMIT) \
     && ( (OSLIBRARY_TYPE == OSL) && (OSLIBRARY_CONFIG == OSS) ) )
#error salvolib.h: OSTASKS exceeds SE library limit -- aborting.
#endif

#endif /* #if OSMAKE_LIBRARY */




/************************************************************/
/************************************************************/
/*                                                          */
/* Begin target-specific settings and overrides             */
/*                                                          */

/*                                                          */
/* Begin PIC12 library special settings and overrides       */
/*                                                          */
#if (OSTARGET == OSPIC12)

#undef  OSBYTES_OF_TICKS
#define OSBYTES_OF_TICKS                0
#undef  OSDISABLE_TASK_PRIORITIES
#define OSDISABLE_TASK_PRIORITIES       TRUE
#undef  OSENABLE_IDLING_HOOK
#define OSENABLE_IDLING_HOOK            FALSE

#if (_BANKBITS_ == 0)
#define OSLOC_ALL                       persistent
#else
#define OSLOC_ALL                       bank1 persistent
#endif


/*                                                          */
/* Begin PIC16 library special settings and overrides       */
/*                                                          */
#elif (OSTARGET == OSPIC16)

#if (_GPRBITS_ == 0)
#define OSLOC_ALL                       persistent
#else
#define OSLOC_ALL                       bank1 persistent
#endif

/*                                                          */
/* Begin PIC17 library special settings and overrides       */
/*                                                          */
#elif (OSTARGET == OSPIC17)

#if (_GPRBITS_ == 0)
#define OSLOC_ALL                       persistent
#else
#define OSLOC_ALL                       bank1 persistent
#endif

/*                                                          */
/* Begin PIC18 library special settings and overrides       */
/*                                                          */
#elif (OSTARGET == OSPIC18)


#if (OSCOMPILER == OSHT_PICC)

/* As of PICC18 v8.35PL3, persistent variables cannot span */
/*  a PIC18 RAM bank boundary, therefore persistent is no  */
/*  longer applied to Salvo's global objects.			   */



#elif (OSCOMPILER == OSMPLAB_C18)


#endif


/*                                                          */
/* Begin V8 library special settings and overrides          */
/*                                                          */
#elif (OSTARGET == OSVAV8)

#define OSLOC_ALL                       persistent


/*                                                          */
/* Begin GCC special settings and overrides                 */
/*                                                          */
#elif (OSTARGET == OSIX86)

#undef  OSBYTES_OF_DELAYS
#define OSBYTES_OF_DELAYS              4
#define OSENABLE_STACK_CHECKING        TRUE
#define OSGATHER_STATISTICS            TRUE
#define OSLOGGING                      TRUE
#define OSLOG_MESSAGES                 OSWARNINGS
#define OSRPT_HIDE_INVALID_POINTERS    TRUE
#define OSRPT_SHOW_ONLY_ACTIVE         FALSE
#define OSRPT_SHOW_TOTAL_DELAY         TRUE


/*                                                          */
/* Begin 8051 special settings and overrides                */
/*                                                          */
#elif (OSTARGET == OSI8051)


/*                                                          */
/* Begin Keil CARM C compiler special settings and          */
/*  overrides for specified targets.                        */
/*                                                          */
#elif (OSCOMPILER == OSKEIL_CARM)


/*                                                          */
/* Begin Microchip MPLAB C30 compiler special settings 		*/
/*  and overrides for specified targets.                    */
/*                                                          */
#elif (OSCOMPILER == OSMPLAB_C30)


/*                                                          */
/* Begin GNU AVR-GCC C compiler special settings and        */
/*  overrides for specified targets.                        */
/*                                                          */
#elif (OSCOMPILER == OSGCC_AVR)


/*                                                          */
/* Begin ARM RealView C compiler special settings and       */
/*  overrides for specified targets.                        */
/*                                                          */
#elif ((OSCOMPILER == OSARM_RVDS) && (OSTARGET == OSARMCM3))



/*                                                          */
/* Begin GCC ARM C compiler for Cortex M3 special settings 	*/
/*  and overrides for specified targets.                    */
/*                                                          */
#elif ((OSCOMPILER == OSGCC_CM3) && (OSTARGET == OSARMCM3))



/*                                                          */
/* Begin IAR C compilers special settings and overrides     */
/*  fior specified targets									*/
/*                                                          */
#elif (OSCOMPILER == OSIAR_ICC)

#if   (OSTARGET == OSPIC18)
#define OSIAR_PIC18_ATTR_ALL            __no_init
#define OSLOC_ALL                       __bank0
#elif (OSTARGET == OSMSP430)
#elif (OSTARGET == OSARM7)
#elif (OSTARGET == OSAVR)
#else
#error salvolib.h: Unknown target for IAR compiler.
#endif


/*                                                          */
/* Begin ImageCraft compilers special settings and          */
/*  overrides for specified targets.                        */
/*                                                          */
#elif (OSCOMPILER == OSIMAGECRAFT)

#if   (OSTARGET == OSARM7)
#undef  OSBYTES_OF_DELAYS
#define OSBYTES_OF_DELAYS              4 /* ARM is 32-bit native */

#elif (OSTARGET == OSAVR)
#elif (OSTARGET == OSM68HC11)
#elif (OSTARGET == OSMSP430)
#else
#error salvolib.h: Unknown target for ImageCraft compiler.
#endif



/*                                                          */
/* Begin CrossWorks compiler special settings and           */
/*  overrides for specified targets.                        */
/*                                                          */
#elif (OSCOMPILER == OSRA_CROSSSTUDIO)

#if   (OSTARGET == OSMSP430 )
#else
#error salvolib.h: Unknown target for CrossWorks compiler.
#endif



/*                                                          */
/* Begin AQ430 compiler target special settings and         */
/*  overrides                                               */
/*                                                          */
#elif (OSCOMPILER == OSAQ_430)



/*                                                          */
/* Begin HT430 compiler target special settings and         */
/*  overrides                                               */
/*                                                          */
#elif (OSCOMPILER == OSHT_430C)



/*                                                          */
/* Begin EZ8 library special settings and overrides         */
/*                                                          */
#elif (OSTARGET == OSEZ8)



/*                                                          */
/* Begin GCC ARM library special settings and overrides     */
/*                                                          */
#elif (OSCOMPILER == OSGCC_ARM)



/*                                                          */
/* Begin TMS320C28X library special settings and overrides  */
/*                                                          */
#elif (OSTARGET == OSTMS320C24X) || (OSTARGET == OSTMS320C28X)


/*                                                          */
/* Undefined OSTARGET                                       */
/*                                                          */
#else
#error salvolib.h: Undefined target (OSTARGET) -- aborting.
#endif

#else

#error salvolib.h: Undefined compiler (OSCOMPILER) -- aborting.

#endif /* #if OSCOMPILER == ... */


/************************************************************/
/************************************************************/
/*                                                          */
/* For custom user libraries. Up to 20 custom libraries are */
/*  supported without editing this file.                    */
/*                                                          */
/* To use this feature to create custom libraries, the user */
/*  must invoke Salvo's Makefiles with an additional make   */
/*  command-line argument, e.g.                             */
/*                                                          */
/*      make libslicc430ia.a CLC=5                          */
/*                                                          */
/* This Custom Library Configuration command-line argument  */
/*  will result in a user-defined, additional header file   */
/*  (in this case, salvoclc5.h) being appended to           */
/*  salvolib.h. In the user header file, the user should    */
/*  undefine and then redefine those Salvo configuration    */
/*  options he/she wishes to override when building the     */
/*  custom library, e.g.                                    */
/*                                                          */
/*      #undef    OSBYTES_OF_DELAYS                         */
/*      #define   OSBYTES_OF_DELAYS 2                       */
/*                                                          */
/*  will result in libraries that support 16-bit delays (a  */
/*  configuration that differs from the default).           */
/*                                                          */
/* It is up to the user to define configuration options     */
/*  that are appropriate for the particular Salvo library   */
/*  being generated. It is recommended that users employ    */
/*  unique names for custom libraries -- the libraries      */
/*  should be renamed after they are generated from within  */
/*  the Salvo makefile system.                              */
/*                                                          */
/* To use a custom user library in a Salvo library build,   */
/*  it is necessary to add the following configuration      */
/*  option to the project's salvocfg.h:                     */
/*                                                          */
/*      #define OSCUSTOM_LIBRARY_CONFIG n                   */
/*                                                          */
/*  where n is the custom library config of interest (5,    */
/*  in the example above).                                  */
/*                                                          */
/************************************************************/
#if !defined(OSCUSTOM_LIBRARY_CONFIG)
#define OSCUSTOM_LIBRARY_CONFIG			0
#endif

#if   (OSCUSTOM_LIBRARY_CONFIG ==  1)
#include "salvoclc1.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  2)
#include "salvoclc2.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  3)
#include "salvoclc3.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  4)
#include "salvoclc4.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  5)
#include "salvoclc5.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  6)
#include "salvoclc6.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  7)
#include "salvoclc7.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  8)
#include "salvoclc8.h"
#elif (OSCUSTOM_LIBRARY_CONFIG ==  9)
#include "salvoclc9.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 10)
#include "salvoclc10.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 11)
#include "salvoclc11.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 12)
#include "salvoclc12.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 13)
#include "salvoclc13.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 14)
#include "salvoclc14.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 15)
#include "salvoclc15.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 16)
#include "salvoclc16.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 17)
#include "salvoclc17.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 18)
#include "salvoclc18.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 19)
#include "salvoclc19.h"
#elif (OSCUSTOM_LIBRARY_CONFIG == 20)
#include "salvoclc20.h"
#elif (OSCUSTOM_LIBRARY_CONFIG >  20)
#error salvolib.h: Nonexistant custom library config file salvoclcN.h -- aborting.
#endif

