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