Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers scmRTOS_TARGET_CFG.h Source File

scmRTOS_TARGET_CFG.h

00001 //******************************************************************************
00002 //*
00003 //*     FULLNAME:  Single-Chip Microcontroller Real-Time Operating System
00004 //*
00005 //*     NICKNAME:  scmRTOS
00006 //*
00007 //*     PROCESSOR: ARM Cortex-M3 
00008 //*
00009 //*     TOOLKIT:   EWARM (IAR Systems)
00010 //*
00011 //*     PURPOSE:   Project Level Target Extensions Config
00012 //*
00013 //*     Version: 3.10
00014 //*
00015 //*     $Revision: 196 $
00016 //*     $Date:: 2008-06-19 #$
00017 //*
00018 //*     Copyright (c) 2003-2010, Harry E. Zhurov
00019 //*
00020 //*     Permission is hereby granted, free of charge, to any person 
00021 //*     obtaining  a copy of this software and associated documentation 
00022 //*     files (the "Software"), to deal in the Software without restriction, 
00023 //*     including without limitation the rights to use, copy, modify, merge, 
00024 //*     publish, distribute, sublicense, and/or sell copies of the Software, 
00025 //*     and to permit persons to whom the Software is furnished to do so, 
00026 //*     subject to the following conditions:
00027 //*
00028 //*     The above copyright notice and this permission notice shall be included 
00029 //*     in all copies or substantial portions of the Software.
00030 //*
00031 //*     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
00032 //*     EXPRESS  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
00033 //*     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
00034 //*     IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 
00035 //*     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
00036 //*     TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH 
00037 //*     THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00038 //*
00039 //*     =================================================================
00040 //*     See http://scmrtos.sourceforge.net for documentation, latest
00041 //*     information, license and contact details.
00042 //*     =================================================================
00043 //*
00044 //******************************************************************************
00045 //*     mbed port by Igor Skochinsky
00046 
00047 #ifndef  scmRTOS_TARGET_CFG_H
00048 #define  scmRTOS_TARGET_CFG_H
00049 
00050 #include "device.h"
00051 
00052 // Define SysTick clock frequency and its interrupt rate in Hz.
00053 #define SYSTICKFREQ     100000000
00054 #define SYSTICKINTRATE  1000
00055 
00056 //------------------------------------------------------------------------------
00057 //
00058 //       System Timer stuff
00059 //
00060 //
00061 namespace OS
00062 {
00063 extern "C" void SysTick_Handler();
00064 }
00065 
00066 #define  LOCK_SYSTEM_TIMER()    ( *CPU_SYSTICKCSR &= ~CPU_SYSTICKCSR_EINT )
00067 #define  UNLOCK_SYSTEM_TIMER()  ( *CPU_SYSTICKCSR |=  CPU_SYSTICKCSR_EINT )
00068 
00069 //------------------------------------------------------------------------------
00070 //
00071 //       Context Switch ISR stuff
00072 //
00073 //
00074 namespace OS
00075 {
00076 #if scmRTOS_IDLE_HOOK_ENABLE == 1
00077     void IdleProcessUserHook();
00078 #endif
00079 
00080 #if scmRTOS_CONTEXT_SWITCH_SCHEME == 1
00081 
00082     INLINE inline void RaiseContextSwitch() { *CPU_ICSR |= 0x10000000; }
00083 
00084     #define ENABLE_NESTED_INTERRUPTS()
00085     
00086     #if scmRTOS_SYSTIMER_NEST_INTS_ENABLE == 0
00087         #define DISABLE_NESTED_INTERRUPTS() TCritSect cs
00088     #else
00089         #define DISABLE_NESTED_INTERRUPTS()
00090     #endif
00091 
00092 #else
00093     #error "Cortex-M3 port supports software interrupt switch method only!"
00094 
00095 #endif // scmRTOS_CONTEXT_SWITCH_SCHEME
00096 
00097 }
00098 //-----------------------------------------------------------------------------
00099 
00100 #endif // scmRTOS_TARGET_CFG_H
00101 //-----------------------------------------------------------------------------
00102