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