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