Dependencies:   PinDetect TextLCD mbed mRotaryEncoder

Committer:
cicklaus
Date:
Mon Feb 13 02:11:20 2012 +0000
Revision:
0:afb2650fb49a

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cicklaus 0:afb2650fb49a 1 //******************************************************************************
cicklaus 0:afb2650fb49a 2 //*
cicklaus 0:afb2650fb49a 3 //* FULLNAME: Single-Chip Microcontroller Real-Time Operating System
cicklaus 0:afb2650fb49a 4 //*
cicklaus 0:afb2650fb49a 5 //* NICKNAME: scmRTOS
cicklaus 0:afb2650fb49a 6 //*
cicklaus 0:afb2650fb49a 7 //* PROCESSOR: ARM Cortex-M3
cicklaus 0:afb2650fb49a 8 //*
cicklaus 0:afb2650fb49a 9 //* TOOLKIT: EWARM (IAR Systems)
cicklaus 0:afb2650fb49a 10 //*
cicklaus 0:afb2650fb49a 11 //* PURPOSE: Project Level Target Extensions Config
cicklaus 0:afb2650fb49a 12 //*
cicklaus 0:afb2650fb49a 13 //* Version: 3.10
cicklaus 0:afb2650fb49a 14 //*
cicklaus 0:afb2650fb49a 15 //* $Revision: 196 $
cicklaus 0:afb2650fb49a 16 //* $Date:: 2008-06-19 #$
cicklaus 0:afb2650fb49a 17 //*
cicklaus 0:afb2650fb49a 18 //* Copyright (c) 2003-2010, Harry E. Zhurov
cicklaus 0:afb2650fb49a 19 //*
cicklaus 0:afb2650fb49a 20 //* Permission is hereby granted, free of charge, to any person
cicklaus 0:afb2650fb49a 21 //* obtaining a copy of this software and associated documentation
cicklaus 0:afb2650fb49a 22 //* files (the "Software"), to deal in the Software without restriction,
cicklaus 0:afb2650fb49a 23 //* including without limitation the rights to use, copy, modify, merge,
cicklaus 0:afb2650fb49a 24 //* publish, distribute, sublicense, and/or sell copies of the Software,
cicklaus 0:afb2650fb49a 25 //* and to permit persons to whom the Software is furnished to do so,
cicklaus 0:afb2650fb49a 26 //* subject to the following conditions:
cicklaus 0:afb2650fb49a 27 //*
cicklaus 0:afb2650fb49a 28 //* The above copyright notice and this permission notice shall be included
cicklaus 0:afb2650fb49a 29 //* in all copies or substantial portions of the Software.
cicklaus 0:afb2650fb49a 30 //*
cicklaus 0:afb2650fb49a 31 //* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
cicklaus 0:afb2650fb49a 32 //* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
cicklaus 0:afb2650fb49a 33 //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
cicklaus 0:afb2650fb49a 34 //* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
cicklaus 0:afb2650fb49a 35 //* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
cicklaus 0:afb2650fb49a 36 //* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
cicklaus 0:afb2650fb49a 37 //* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cicklaus 0:afb2650fb49a 38 //*
cicklaus 0:afb2650fb49a 39 //* =================================================================
cicklaus 0:afb2650fb49a 40 //* See http://scmrtos.sourceforge.net for documentation, latest
cicklaus 0:afb2650fb49a 41 //* information, license and contact details.
cicklaus 0:afb2650fb49a 42 //* =================================================================
cicklaus 0:afb2650fb49a 43 //*
cicklaus 0:afb2650fb49a 44 //******************************************************************************
cicklaus 0:afb2650fb49a 45 //* mbed port by Igor Skochinsky
cicklaus 0:afb2650fb49a 46
cicklaus 0:afb2650fb49a 47 #ifndef scmRTOS_TARGET_CFG_H
cicklaus 0:afb2650fb49a 48 #define scmRTOS_TARGET_CFG_H
cicklaus 0:afb2650fb49a 49
cicklaus 0:afb2650fb49a 50 #include "device.h"
cicklaus 0:afb2650fb49a 51
cicklaus 0:afb2650fb49a 52 // Define SysTick clock frequency and its interrupt rate in Hz.
cicklaus 0:afb2650fb49a 53 #define SYSTICKFREQ 100000000
cicklaus 0:afb2650fb49a 54 #define SYSTICKINTRATE 1000
cicklaus 0:afb2650fb49a 55
cicklaus 0:afb2650fb49a 56 //------------------------------------------------------------------------------
cicklaus 0:afb2650fb49a 57 //
cicklaus 0:afb2650fb49a 58 // System Timer stuff
cicklaus 0:afb2650fb49a 59 //
cicklaus 0:afb2650fb49a 60 //
cicklaus 0:afb2650fb49a 61 namespace OS
cicklaus 0:afb2650fb49a 62 {
cicklaus 0:afb2650fb49a 63 extern "C" void SysTick_Handler();
cicklaus 0:afb2650fb49a 64 }
cicklaus 0:afb2650fb49a 65
cicklaus 0:afb2650fb49a 66 #define LOCK_SYSTEM_TIMER() ( *CPU_SYSTICKCSR &= ~CPU_SYSTICKCSR_EINT )
cicklaus 0:afb2650fb49a 67 #define UNLOCK_SYSTEM_TIMER() ( *CPU_SYSTICKCSR |= CPU_SYSTICKCSR_EINT )
cicklaus 0:afb2650fb49a 68
cicklaus 0:afb2650fb49a 69 //------------------------------------------------------------------------------
cicklaus 0:afb2650fb49a 70 //
cicklaus 0:afb2650fb49a 71 // Context Switch ISR stuff
cicklaus 0:afb2650fb49a 72 //
cicklaus 0:afb2650fb49a 73 //
cicklaus 0:afb2650fb49a 74 namespace OS
cicklaus 0:afb2650fb49a 75 {
cicklaus 0:afb2650fb49a 76 #if scmRTOS_IDLE_HOOK_ENABLE == 1
cicklaus 0:afb2650fb49a 77 void IdleProcessUserHook();
cicklaus 0:afb2650fb49a 78 #endif
cicklaus 0:afb2650fb49a 79
cicklaus 0:afb2650fb49a 80 #if scmRTOS_CONTEXT_SWITCH_SCHEME == 1
cicklaus 0:afb2650fb49a 81
cicklaus 0:afb2650fb49a 82 INLINE inline void RaiseContextSwitch() { *CPU_ICSR |= 0x10000000; }
cicklaus 0:afb2650fb49a 83
cicklaus 0:afb2650fb49a 84 #define ENABLE_NESTED_INTERRUPTS()
cicklaus 0:afb2650fb49a 85
cicklaus 0:afb2650fb49a 86 #if scmRTOS_SYSTIMER_NEST_INTS_ENABLE == 0
cicklaus 0:afb2650fb49a 87 #define DISABLE_NESTED_INTERRUPTS() TCritSect cs
cicklaus 0:afb2650fb49a 88 #else
cicklaus 0:afb2650fb49a 89 #define DISABLE_NESTED_INTERRUPTS()
cicklaus 0:afb2650fb49a 90 #endif
cicklaus 0:afb2650fb49a 91
cicklaus 0:afb2650fb49a 92 #else
cicklaus 0:afb2650fb49a 93 #error "Cortex-M3 port supports software interrupt switch method only!"
cicklaus 0:afb2650fb49a 94
cicklaus 0:afb2650fb49a 95 #endif // scmRTOS_CONTEXT_SWITCH_SCHEME
cicklaus 0:afb2650fb49a 96
cicklaus 0:afb2650fb49a 97 }
cicklaus 0:afb2650fb49a 98 //-----------------------------------------------------------------------------
cicklaus 0:afb2650fb49a 99
cicklaus 0:afb2650fb49a 100 #endif // scmRTOS_TARGET_CFG_H
cicklaus 0:afb2650fb49a 101 //-----------------------------------------------------------------------------
cicklaus 0:afb2650fb49a 102