Quick and dirty port of scmRTOS demo to mbed 1768. scmRTOS is a small RTOS written using C++. Offers (static) processes, critical sections, mutexes, messages, channels.

Dependencies:   mbed

Committer:
igorsk
Date:
Thu Sep 09 21:19:01 2010 +0000
Revision:
0:a405220cf420

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
igorsk 0:a405220cf420 1 //******************************************************************************
igorsk 0:a405220cf420 2 //*
igorsk 0:a405220cf420 3 //* FULLNAME: Single-Chip Microcontroller Real-Time Operating System
igorsk 0:a405220cf420 4 //*
igorsk 0:a405220cf420 5 //* NICKNAME: scmRTOS
igorsk 0:a405220cf420 6 //*
igorsk 0:a405220cf420 7 //* PROCESSOR: ARM Cortex-M3
igorsk 0:a405220cf420 8 //*
igorsk 0:a405220cf420 9 //* TOOLKIT: EWARM (IAR Systems)
igorsk 0:a405220cf420 10 //*
igorsk 0:a405220cf420 11 //* PURPOSE: Project Level Configuration
igorsk 0:a405220cf420 12 //*
igorsk 0:a405220cf420 13 //* Version: 3.10
igorsk 0:a405220cf420 14 //*
igorsk 0:a405220cf420 15 //* $Revision: 196 $
igorsk 0:a405220cf420 16 //* $Date:: 2008-06-19 #$
igorsk 0:a405220cf420 17 //*
igorsk 0:a405220cf420 18 //* Copyright (c) 2003-2010, Harry E. Zhurov
igorsk 0:a405220cf420 19 //*
igorsk 0:a405220cf420 20 //* Permission is hereby granted, free of charge, to any person
igorsk 0:a405220cf420 21 //* obtaining a copy of this software and associated documentation
igorsk 0:a405220cf420 22 //* files (the "Software"), to deal in the Software without restriction,
igorsk 0:a405220cf420 23 //* including without limitation the rights to use, copy, modify, merge,
igorsk 0:a405220cf420 24 //* publish, distribute, sublicense, and/or sell copies of the Software,
igorsk 0:a405220cf420 25 //* and to permit persons to whom the Software is furnished to do so,
igorsk 0:a405220cf420 26 //* subject to the following conditions:
igorsk 0:a405220cf420 27 //*
igorsk 0:a405220cf420 28 //* The above copyright notice and this permission notice shall be included
igorsk 0:a405220cf420 29 //* in all copies or substantial portions of the Software.
igorsk 0:a405220cf420 30 //*
igorsk 0:a405220cf420 31 //* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
igorsk 0:a405220cf420 32 //* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
igorsk 0:a405220cf420 33 //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
igorsk 0:a405220cf420 34 //* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
igorsk 0:a405220cf420 35 //* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
igorsk 0:a405220cf420 36 //* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
igorsk 0:a405220cf420 37 //* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
igorsk 0:a405220cf420 38 //*
igorsk 0:a405220cf420 39 //* =================================================================
igorsk 0:a405220cf420 40 //* See http://scmrtos.sourceforge.net for documentation, latest
igorsk 0:a405220cf420 41 //* information, license and contact details.
igorsk 0:a405220cf420 42 //* =================================================================
igorsk 0:a405220cf420 43 //*
igorsk 0:a405220cf420 44 //******************************************************************************
igorsk 0:a405220cf420 45 //* Ported by Andrey Chuikin, Copyright (c) 2008-2010
igorsk 0:a405220cf420 46
igorsk 0:a405220cf420 47 #ifndef scmRTOS_CONFIG_H
igorsk 0:a405220cf420 48 #define scmRTOS_CONFIG_H
igorsk 0:a405220cf420 49
igorsk 0:a405220cf420 50 #ifndef __IAR_SYSTEMS_ASM__
igorsk 0:a405220cf420 51 #include <commdefs.h>
igorsk 0:a405220cf420 52
igorsk 0:a405220cf420 53 typedef word TTimeout;
igorsk 0:a405220cf420 54
igorsk 0:a405220cf420 55 #endif // __IAR_SYSTEMS_ASM__
igorsk 0:a405220cf420 56
igorsk 0:a405220cf420 57 #include "device.h"
igorsk 0:a405220cf420 58 //------------------------------------------------------------------------------
igorsk 0:a405220cf420 59 //
igorsk 0:a405220cf420 60 // Specify scmRTOS Process Count. Must be less than 31
igorsk 0:a405220cf420 61 //
igorsk 0:a405220cf420 62 //
igorsk 0:a405220cf420 63 #define scmRTOS_PROCESS_COUNT 3
igorsk 0:a405220cf420 64
igorsk 0:a405220cf420 65 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 66 //
igorsk 0:a405220cf420 67 // scmRTOS System Timer
igorsk 0:a405220cf420 68 //
igorsk 0:a405220cf420 69 // Nested Interrupts enable macro. Value 1 means that interrupts are
igorsk 0:a405220cf420 70 // globally enabled within System Timer ISR (this is default for Cortex-M3).
igorsk 0:a405220cf420 71 //
igorsk 0:a405220cf420 72 //
igorsk 0:a405220cf420 73 #define scmRTOS_SYSTIMER_NEST_INTS_ENABLE 1
igorsk 0:a405220cf420 74
igorsk 0:a405220cf420 75 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 76 //
igorsk 0:a405220cf420 77 // scmRTOS System Timer Tick Counter Enable
igorsk 0:a405220cf420 78 //
igorsk 0:a405220cf420 79 //
igorsk 0:a405220cf420 80 #define scmRTOS_SYSTEM_TICKS_ENABLE 1
igorsk 0:a405220cf420 81
igorsk 0:a405220cf420 82
igorsk 0:a405220cf420 83 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 84 //
igorsk 0:a405220cf420 85 // scmRTOS System Timer Hook
igorsk 0:a405220cf420 86 //
igorsk 0:a405220cf420 87 //
igorsk 0:a405220cf420 88 #define scmRTOS_SYSTIMER_HOOK_ENABLE 1
igorsk 0:a405220cf420 89
igorsk 0:a405220cf420 90 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 91 //
igorsk 0:a405220cf420 92 // scmRTOS Idle Process Hook
igorsk 0:a405220cf420 93 //
igorsk 0:a405220cf420 94 //
igorsk 0:a405220cf420 95 #define scmRTOS_IDLE_HOOK_ENABLE 1
igorsk 0:a405220cf420 96
igorsk 0:a405220cf420 97 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 98 //
igorsk 0:a405220cf420 99 // scmRTOS Idle Process Stack size (in bytes)
igorsk 0:a405220cf420 100 // (20 * sizeof(TStackItem)) - it's a minimum allowed value.
igorsk 0:a405220cf420 101 //
igorsk 0:a405220cf420 102 #define scmRTOS_IDLE_PROCESS_STACK_SIZE (20 * sizeof(TStackItem))
igorsk 0:a405220cf420 103
igorsk 0:a405220cf420 104 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 105 //
igorsk 0:a405220cf420 106 // scmRTOS Priority Order
igorsk 0:a405220cf420 107 //
igorsk 0:a405220cf420 108 // This macro defines the order of the process's priorities. Default,
igorsk 0:a405220cf420 109 // the ascending order is used. Alternatively, the descending priority
igorsk 0:a405220cf420 110 // order can be used. On some platforms the descending order is preferred
igorsk 0:a405220cf420 111 // because of performance.
igorsk 0:a405220cf420 112 //
igorsk 0:a405220cf420 113 // Default (corresponding to ascending order) value of macro is 0.
igorsk 0:a405220cf420 114 // Alternative (corresponding to descending order) value of macro is 1.
igorsk 0:a405220cf420 115 //
igorsk 0:a405220cf420 116 // On Cortex-M3 the descending order is preferred for performance reason.
igorsk 0:a405220cf420 117 //
igorsk 0:a405220cf420 118 #define scmRTOS_PRIORITY_ORDER 1
igorsk 0:a405220cf420 119
igorsk 0:a405220cf420 120 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 121 //
igorsk 0:a405220cf420 122 // scmRTOS Context Switch User Hook enable
igorsk 0:a405220cf420 123 //
igorsk 0:a405220cf420 124 // The macro enables/disables user defined hook called from system
igorsk 0:a405220cf420 125 // Context Switch Hook function.
igorsk 0:a405220cf420 126 //
igorsk 0:a405220cf420 127 //
igorsk 0:a405220cf420 128 #define scmRTOS_CONTEXT_SWITCH_USER_HOOK_ENABLE 0
igorsk 0:a405220cf420 129
igorsk 0:a405220cf420 130
igorsk 0:a405220cf420 131 #endif // scmRTOS_CONFIG_H
igorsk 0:a405220cf420 132 //-----------------------------------------------------------------------------
igorsk 0:a405220cf420 133