Clone of mbed rtos 2 for easy accessibility.
Fork of mbed-rtos by
rtx/TARGET_CORTEX_M/RTX_Conf_CM.c@58:13a25134ac60, 2014-12-16 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Dec 16 08:15:25 2014 +0000
- Revision:
- 58:13a25134ac60
- Parent:
- 57:430de2831ec7
- Child:
- 59:28712e303960
Synchronized with git revision 67fbbf0b635d0c0d93fbe433306c537c2ad206aa
Full URL: https://github.com/mbedmicro/mbed/commit/67fbbf0b635d0c0d93fbe433306c537c2ad206aa/
Targets: nrf51 - updating app_timer.c from Norid'c SDKv7.1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 49:77c8e4604045 | 1 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 2 | * RL-ARM - RTX |
mbed_official | 49:77c8e4604045 | 3 | *---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 4 | * Name: RTX_Conf_CM.C |
mbed_official | 49:77c8e4604045 | 5 | * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M |
mbed_official | 49:77c8e4604045 | 6 | * Rev.: V4.60 |
mbed_official | 49:77c8e4604045 | 7 | *---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 8 | * |
mbed_official | 49:77c8e4604045 | 9 | * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH |
mbed_official | 49:77c8e4604045 | 10 | * All rights reserved. |
mbed_official | 49:77c8e4604045 | 11 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 49:77c8e4604045 | 12 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 49:77c8e4604045 | 13 | * - Redistributions of source code must retain the above copyright |
mbed_official | 49:77c8e4604045 | 14 | * notice, this list of conditions and the following disclaimer. |
mbed_official | 49:77c8e4604045 | 15 | * - Redistributions in binary form must reproduce the above copyright |
mbed_official | 49:77c8e4604045 | 16 | * notice, this list of conditions and the following disclaimer in the |
mbed_official | 49:77c8e4604045 | 17 | * documentation and/or other materials provided with the distribution. |
mbed_official | 49:77c8e4604045 | 18 | * - Neither the name of ARM nor the names of its contributors may be used |
mbed_official | 49:77c8e4604045 | 19 | * to endorse or promote products derived from this software without |
mbed_official | 49:77c8e4604045 | 20 | * specific prior written permission. |
mbed_official | 49:77c8e4604045 | 21 | * |
mbed_official | 49:77c8e4604045 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 49:77c8e4604045 | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 49:77c8e4604045 | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
mbed_official | 49:77c8e4604045 | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE |
mbed_official | 49:77c8e4604045 | 26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
mbed_official | 49:77c8e4604045 | 27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
mbed_official | 49:77c8e4604045 | 28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
mbed_official | 49:77c8e4604045 | 29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
mbed_official | 49:77c8e4604045 | 30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
mbed_official | 49:77c8e4604045 | 31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
mbed_official | 49:77c8e4604045 | 32 | * POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 49:77c8e4604045 | 33 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 34 | |
mbed_official | 49:77c8e4604045 | 35 | #include "cmsis_os.h" |
mbed_official | 49:77c8e4604045 | 36 | |
mbed_official | 49:77c8e4604045 | 37 | |
mbed_official | 49:77c8e4604045 | 38 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 39 | * RTX User configuration part BEGIN |
mbed_official | 49:77c8e4604045 | 40 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 41 | |
mbed_official | 49:77c8e4604045 | 42 | //-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- |
mbed_official | 49:77c8e4604045 | 43 | // |
mbed_official | 49:77c8e4604045 | 44 | // <h>Thread Configuration |
mbed_official | 49:77c8e4604045 | 45 | // ======================= |
mbed_official | 49:77c8e4604045 | 46 | // |
mbed_official | 49:77c8e4604045 | 47 | // <o>Number of concurrent running threads <0-250> |
mbed_official | 49:77c8e4604045 | 48 | // <i> Defines max. number of threads that will run at the same time. |
mbed_official | 49:77c8e4604045 | 49 | // counting "main", but not counting "osTimerThread" |
mbed_official | 49:77c8e4604045 | 50 | // <i> Default: 6 |
mbed_official | 49:77c8e4604045 | 51 | #ifndef OS_TASKCNT |
mbed_official | 49:77c8e4604045 | 52 | # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC4337) || defined(TARGET_LPC1347) || defined(TARGET_K64F) || defined(TARGET_STM32F401RE)\ |
mbed_official | 52:02f5cf381388 | 53 | || defined(TARGET_KL46Z) || defined(TARGET_KL43Z) || defined(TARGET_STM32F407) || defined(TARGET_F407VG) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_LPC11U68) || defined(TARGET_NRF51822) || defined(TARGET_STM32F411RE) \ |
mbed_official | 57:430de2831ec7 | 54 | || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) |
mbed_official | 49:77c8e4604045 | 55 | # define OS_TASKCNT 14 |
mbed_official | 49:77c8e4604045 | 56 | # elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO) || defined(TARGET_LPC1114) \ |
mbed_official | 52:02f5cf381388 | 57 | || defined(TARGET_LPC812) || defined(TARGET_KL25Z) || defined(TARGET_KL05Z) || defined(TARGET_STM32F100RB) || defined(TARGET_STM32F051R8) \ |
mbed_official | 52:02f5cf381388 | 58 | || defined(TARGET_STM32F103RB) || defined(TARGET_LPC824) || defined(TARGET_STM32F302R8) || defined(TARGET_STM32F334R8) || defined(TARGET_STM32F334C8) |
mbed_official | 49:77c8e4604045 | 59 | # define OS_TASKCNT 6 |
mbed_official | 49:77c8e4604045 | 60 | # else |
mbed_official | 49:77c8e4604045 | 61 | # error "no target defined" |
mbed_official | 49:77c8e4604045 | 62 | # endif |
mbed_official | 49:77c8e4604045 | 63 | #endif |
mbed_official | 49:77c8e4604045 | 64 | |
mbed_official | 49:77c8e4604045 | 65 | // <o>Scheduler (+ interrupts) stack size [bytes] <64-4096:8><#/4> |
mbed_official | 49:77c8e4604045 | 66 | #ifndef OS_SCHEDULERSTKSIZE |
mbed_official | 49:77c8e4604045 | 67 | # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC4337) || defined(TARGET_LPC1347) || defined(TARGET_K64F) || defined(TARGET_STM32F401RE)\ |
mbed_official | 52:02f5cf381388 | 68 | || defined(TARGET_KL46Z) || defined(TARGET_KL43Z) || defined(TARGET_STM32F407) || defined(TARGET_F407VG) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_LPC11U68) || defined(TARGET_NRF51822) || defined(TARGET_STM32F411RE) \ |
mbed_official | 57:430de2831ec7 | 69 | || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) |
mbed_official | 49:77c8e4604045 | 70 | # define OS_SCHEDULERSTKSIZE 256 |
mbed_official | 49:77c8e4604045 | 71 | # elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO) || defined(TARGET_LPC1114) \ |
mbed_official | 52:02f5cf381388 | 72 | || defined(TARGET_LPC812) || defined(TARGET_KL25Z) || defined(TARGET_KL05Z) || defined(TARGET_STM32F100RB) || defined(TARGET_STM32F051R8) \ |
mbed_official | 52:02f5cf381388 | 73 | || defined(TARGET_STM32F103RB) || defined(TARGET_LPC824) || defined(TARGET_STM32F302R8) || defined(TARGET_STM32F334R8) || defined(TARGET_STM32F334C8) |
mbed_official | 49:77c8e4604045 | 74 | # define OS_SCHEDULERSTKSIZE 128 |
mbed_official | 49:77c8e4604045 | 75 | # else |
mbed_official | 49:77c8e4604045 | 76 | # error "no target defined" |
mbed_official | 49:77c8e4604045 | 77 | # endif |
mbed_official | 49:77c8e4604045 | 78 | #endif |
mbed_official | 49:77c8e4604045 | 79 | |
mbed_official | 49:77c8e4604045 | 80 | // <o>Idle stack size [bytes] <64-4096:8><#/4> |
mbed_official | 49:77c8e4604045 | 81 | // <i> Defines default stack size for the Idle thread. |
mbed_official | 49:77c8e4604045 | 82 | #ifndef OS_IDLESTKSIZE |
mbed_official | 49:77c8e4604045 | 83 | #define OS_IDLESTKSIZE 128 |
mbed_official | 49:77c8e4604045 | 84 | #endif |
mbed_official | 49:77c8e4604045 | 85 | |
mbed_official | 49:77c8e4604045 | 86 | // <o>Timer Thread stack size [bytes] <64-4096:8><#/4> |
mbed_official | 49:77c8e4604045 | 87 | // <i> Defines stack size for Timer thread. |
mbed_official | 49:77c8e4604045 | 88 | // <i> Default: 200 |
mbed_official | 49:77c8e4604045 | 89 | #ifndef OS_TIMERSTKSZ |
mbed_official | 49:77c8e4604045 | 90 | #define OS_TIMERSTKSZ WORDS_STACK_SIZE |
mbed_official | 49:77c8e4604045 | 91 | #endif |
mbed_official | 49:77c8e4604045 | 92 | |
mbed_official | 49:77c8e4604045 | 93 | // <q>Check for stack overflow |
mbed_official | 49:77c8e4604045 | 94 | // <i> Includes the stack checking code for stack overflow. |
mbed_official | 49:77c8e4604045 | 95 | // <i> Note that additional code reduces the Kernel performance. |
mbed_official | 49:77c8e4604045 | 96 | #ifndef OS_STKCHECK |
mbed_official | 49:77c8e4604045 | 97 | #define OS_STKCHECK 1 |
mbed_official | 49:77c8e4604045 | 98 | #endif |
mbed_official | 49:77c8e4604045 | 99 | |
mbed_official | 49:77c8e4604045 | 100 | // <o>Processor mode for thread execution |
mbed_official | 49:77c8e4604045 | 101 | // <0=> Unprivileged mode |
mbed_official | 49:77c8e4604045 | 102 | // <1=> Privileged mode |
mbed_official | 49:77c8e4604045 | 103 | // <i> Default: Privileged mode |
mbed_official | 49:77c8e4604045 | 104 | #ifndef OS_RUNPRIV |
mbed_official | 49:77c8e4604045 | 105 | #define OS_RUNPRIV 1 |
mbed_official | 49:77c8e4604045 | 106 | #endif |
mbed_official | 49:77c8e4604045 | 107 | |
mbed_official | 49:77c8e4604045 | 108 | // </h> |
mbed_official | 49:77c8e4604045 | 109 | // <h>SysTick Timer Configuration |
mbed_official | 49:77c8e4604045 | 110 | // ============================== |
mbed_official | 49:77c8e4604045 | 111 | // |
mbed_official | 49:77c8e4604045 | 112 | // <o>Timer clock value [Hz] <1-1000000000> |
mbed_official | 49:77c8e4604045 | 113 | // <i> Defines the timer clock value. |
mbed_official | 49:77c8e4604045 | 114 | // <i> Default: 6000000 (6MHz) |
mbed_official | 49:77c8e4604045 | 115 | #ifndef OS_CLOCK |
mbed_official | 49:77c8e4604045 | 116 | # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) |
mbed_official | 49:77c8e4604045 | 117 | # define OS_CLOCK 96000000 |
mbed_official | 49:77c8e4604045 | 118 | |
mbed_official | 49:77c8e4604045 | 119 | # elif defined(TARGET_LPC1347) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_STM32F302R8) || defined(TARGET_STM32F334R8) || defined(TARGET_STM32F334C8) |
mbed_official | 49:77c8e4604045 | 120 | # define OS_CLOCK 72000000 |
mbed_official | 49:77c8e4604045 | 121 | |
mbed_official | 49:77c8e4604045 | 122 | # elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO) || defined(TARGET_LPC1114) || defined(TARGET_KL25Z) || defined(TARGET_KL05Z) || defined(TARGET_KL46Z) || defined(TARGET_KL43Z) || defined(TARGET_STM32F051R8) || defined(TARGET_LPC11U68) |
mbed_official | 49:77c8e4604045 | 123 | # define OS_CLOCK 48000000 |
mbed_official | 49:77c8e4604045 | 124 | |
mbed_official | 49:77c8e4604045 | 125 | # elif defined(TARGET_LPC812) |
mbed_official | 49:77c8e4604045 | 126 | # define OS_CLOCK 36000000 |
mbed_official | 49:77c8e4604045 | 127 | |
mbed_official | 49:77c8e4604045 | 128 | # elif defined(TARGET_LPC824) |
mbed_official | 49:77c8e4604045 | 129 | # define OS_CLOCK 30000000 |
mbed_official | 49:77c8e4604045 | 130 | |
mbed_official | 49:77c8e4604045 | 131 | # elif defined(TARGET_STM32F100RB) |
mbed_official | 49:77c8e4604045 | 132 | # define OS_CLOCK 24000000 |
mbed_official | 49:77c8e4604045 | 133 | |
mbed_official | 52:02f5cf381388 | 134 | # elif defined(TARGET_LPC4088) || defined(TARGET_K64F) || defined(TARGET_K22F) |
mbed_official | 49:77c8e4604045 | 135 | # define OS_CLOCK 120000000 |
mbed_official | 49:77c8e4604045 | 136 | |
mbed_official | 49:77c8e4604045 | 137 | # elif defined(TARGET_LPC4337) |
mbed_official | 49:77c8e4604045 | 138 | # define OS_CLOCK 204000000 |
mbed_official | 49:77c8e4604045 | 139 | |
mbed_official | 49:77c8e4604045 | 140 | # elif defined(TARGET_STM32F407) || defined(TARGET_F407VG) |
mbed_official | 49:77c8e4604045 | 141 | # define OS_CLOCK 168000000 |
mbed_official | 49:77c8e4604045 | 142 | |
mbed_official | 49:77c8e4604045 | 143 | # elif defined(TARGET_NRF51822) |
mbed_official | 49:77c8e4604045 | 144 | # define OS_CLOCK 16000000 |
mbed_official | 49:77c8e4604045 | 145 | |
mbed_official | 49:77c8e4604045 | 146 | # elif defined(TARGET_STM32F401RE) |
mbed_official | 49:77c8e4604045 | 147 | # define OS_CLOCK 84000000 |
mbed_official | 49:77c8e4604045 | 148 | |
mbed_official | 49:77c8e4604045 | 149 | # elif defined(TARGET_STM32F411RE) |
mbed_official | 49:77c8e4604045 | 150 | # define OS_CLOCK 100000000 |
mbed_official | 49:77c8e4604045 | 151 | |
mbed_official | 49:77c8e4604045 | 152 | #elif defined(TARGET_STM32F103RB) |
mbed_official | 49:77c8e4604045 | 153 | # define OS_CLOCK 72000000 |
mbed_official | 49:77c8e4604045 | 154 | |
mbed_official | 57:430de2831ec7 | 155 | #elif defined(TARGET_STM32F429ZI) |
mbed_official | 58:13a25134ac60 | 156 | # define OS_CLOCK 168000000 |
mbed_official | 57:430de2831ec7 | 157 | |
mbed_official | 49:77c8e4604045 | 158 | # else |
mbed_official | 49:77c8e4604045 | 159 | # error "no target defined" |
mbed_official | 49:77c8e4604045 | 160 | # endif |
mbed_official | 49:77c8e4604045 | 161 | #endif |
mbed_official | 49:77c8e4604045 | 162 | |
mbed_official | 49:77c8e4604045 | 163 | // <o>Timer tick value [us] <1-1000000> |
mbed_official | 49:77c8e4604045 | 164 | // <i> Defines the timer tick value. |
mbed_official | 49:77c8e4604045 | 165 | // <i> Default: 1000 (1ms) |
mbed_official | 49:77c8e4604045 | 166 | #ifndef OS_TICK |
mbed_official | 49:77c8e4604045 | 167 | #define OS_TICK 1000 |
mbed_official | 49:77c8e4604045 | 168 | #endif |
mbed_official | 49:77c8e4604045 | 169 | |
mbed_official | 49:77c8e4604045 | 170 | // </h> |
mbed_official | 49:77c8e4604045 | 171 | |
mbed_official | 49:77c8e4604045 | 172 | // <h>System Configuration |
mbed_official | 49:77c8e4604045 | 173 | // ======================= |
mbed_official | 49:77c8e4604045 | 174 | // |
mbed_official | 49:77c8e4604045 | 175 | // <e>Round-Robin Thread switching |
mbed_official | 49:77c8e4604045 | 176 | // =============================== |
mbed_official | 49:77c8e4604045 | 177 | // |
mbed_official | 49:77c8e4604045 | 178 | // <i> Enables Round-Robin Thread switching. |
mbed_official | 49:77c8e4604045 | 179 | #ifndef OS_ROBIN |
mbed_official | 49:77c8e4604045 | 180 | #define OS_ROBIN 1 |
mbed_official | 49:77c8e4604045 | 181 | #endif |
mbed_official | 49:77c8e4604045 | 182 | |
mbed_official | 49:77c8e4604045 | 183 | // <o>Round-Robin Timeout [ticks] <1-1000> |
mbed_official | 49:77c8e4604045 | 184 | // <i> Defines how long a thread will execute before a thread switch. |
mbed_official | 49:77c8e4604045 | 185 | // <i> Default: 5 |
mbed_official | 49:77c8e4604045 | 186 | #ifndef OS_ROBINTOUT |
mbed_official | 49:77c8e4604045 | 187 | #define OS_ROBINTOUT 5 |
mbed_official | 49:77c8e4604045 | 188 | #endif |
mbed_official | 49:77c8e4604045 | 189 | |
mbed_official | 49:77c8e4604045 | 190 | // </e> |
mbed_official | 49:77c8e4604045 | 191 | |
mbed_official | 49:77c8e4604045 | 192 | // <e>User Timers |
mbed_official | 49:77c8e4604045 | 193 | // ============== |
mbed_official | 49:77c8e4604045 | 194 | // <i> Enables user Timers |
mbed_official | 49:77c8e4604045 | 195 | #ifndef OS_TIMERS |
mbed_official | 49:77c8e4604045 | 196 | #define OS_TIMERS 1 |
mbed_official | 49:77c8e4604045 | 197 | #endif |
mbed_official | 49:77c8e4604045 | 198 | |
mbed_official | 49:77c8e4604045 | 199 | // <o>Timer Thread Priority |
mbed_official | 49:77c8e4604045 | 200 | // <1=> Low |
mbed_official | 49:77c8e4604045 | 201 | // <2=> Below Normal |
mbed_official | 49:77c8e4604045 | 202 | // <3=> Normal |
mbed_official | 49:77c8e4604045 | 203 | // <4=> Above Normal |
mbed_official | 49:77c8e4604045 | 204 | // <5=> High |
mbed_official | 49:77c8e4604045 | 205 | // <6=> Realtime (highest) |
mbed_official | 49:77c8e4604045 | 206 | // <i> Defines priority for Timer Thread |
mbed_official | 49:77c8e4604045 | 207 | // <i> Default: High |
mbed_official | 49:77c8e4604045 | 208 | #ifndef OS_TIMERPRIO |
mbed_official | 49:77c8e4604045 | 209 | #define OS_TIMERPRIO 5 |
mbed_official | 49:77c8e4604045 | 210 | #endif |
mbed_official | 49:77c8e4604045 | 211 | |
mbed_official | 49:77c8e4604045 | 212 | // <o>Timer Callback Queue size <1-32> |
mbed_official | 49:77c8e4604045 | 213 | // <i> Number of concurrent active timer callback functions. |
mbed_official | 49:77c8e4604045 | 214 | // <i> Default: 4 |
mbed_official | 49:77c8e4604045 | 215 | #ifndef OS_TIMERCBQSZ |
mbed_official | 49:77c8e4604045 | 216 | #define OS_TIMERCBQS 4 |
mbed_official | 49:77c8e4604045 | 217 | #endif |
mbed_official | 49:77c8e4604045 | 218 | |
mbed_official | 49:77c8e4604045 | 219 | // </e> |
mbed_official | 49:77c8e4604045 | 220 | |
mbed_official | 49:77c8e4604045 | 221 | // <o>ISR FIFO Queue size<4=> 4 entries <8=> 8 entries |
mbed_official | 49:77c8e4604045 | 222 | // <12=> 12 entries <16=> 16 entries |
mbed_official | 49:77c8e4604045 | 223 | // <24=> 24 entries <32=> 32 entries |
mbed_official | 49:77c8e4604045 | 224 | // <48=> 48 entries <64=> 64 entries |
mbed_official | 49:77c8e4604045 | 225 | // <96=> 96 entries |
mbed_official | 49:77c8e4604045 | 226 | // <i> ISR functions store requests to this buffer, |
mbed_official | 49:77c8e4604045 | 227 | // <i> when they are called from the interrupt handler. |
mbed_official | 49:77c8e4604045 | 228 | // <i> Default: 16 entries |
mbed_official | 49:77c8e4604045 | 229 | #ifndef OS_FIFOSZ |
mbed_official | 49:77c8e4604045 | 230 | #define OS_FIFOSZ 16 |
mbed_official | 49:77c8e4604045 | 231 | #endif |
mbed_official | 49:77c8e4604045 | 232 | |
mbed_official | 49:77c8e4604045 | 233 | // </h> |
mbed_official | 49:77c8e4604045 | 234 | |
mbed_official | 49:77c8e4604045 | 235 | //------------- <<< end of configuration section >>> ----------------------- |
mbed_official | 49:77c8e4604045 | 236 | |
mbed_official | 49:77c8e4604045 | 237 | // Standard library system mutexes |
mbed_official | 49:77c8e4604045 | 238 | // =============================== |
mbed_official | 49:77c8e4604045 | 239 | // Define max. number system mutexes that are used to protect |
mbed_official | 49:77c8e4604045 | 240 | // the arm standard runtime library. For microlib they are not used. |
mbed_official | 49:77c8e4604045 | 241 | #ifndef OS_MUTEXCNT |
mbed_official | 49:77c8e4604045 | 242 | #define OS_MUTEXCNT 12 |
mbed_official | 49:77c8e4604045 | 243 | #endif |
mbed_official | 49:77c8e4604045 | 244 | |
mbed_official | 49:77c8e4604045 | 245 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 246 | * RTX User configuration part END |
mbed_official | 49:77c8e4604045 | 247 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 248 | |
mbed_official | 49:77c8e4604045 | 249 | #define OS_TRV ((uint32_t)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1) |
mbed_official | 49:77c8e4604045 | 250 | |
mbed_official | 49:77c8e4604045 | 251 | |
mbed_official | 49:77c8e4604045 | 252 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 253 | * OS Idle daemon |
mbed_official | 49:77c8e4604045 | 254 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 255 | void os_idle_demon (void) { |
mbed_official | 49:77c8e4604045 | 256 | /* The idle demon is a system thread, running when no other thread is */ |
mbed_official | 49:77c8e4604045 | 257 | /* ready to run. */ |
mbed_official | 49:77c8e4604045 | 258 | |
mbed_official | 49:77c8e4604045 | 259 | /* Sleep: ideally, we should put the chip to sleep. |
mbed_official | 49:77c8e4604045 | 260 | Unfortunately, this usually requires disconnecting the interface chip (debugger). |
mbed_official | 49:77c8e4604045 | 261 | This can be done, but it would break the local file system. |
mbed_official | 49:77c8e4604045 | 262 | */ |
mbed_official | 49:77c8e4604045 | 263 | for (;;) { |
mbed_official | 49:77c8e4604045 | 264 | // sleep(); |
mbed_official | 49:77c8e4604045 | 265 | } |
mbed_official | 49:77c8e4604045 | 266 | } |
mbed_official | 49:77c8e4604045 | 267 | |
mbed_official | 49:77c8e4604045 | 268 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 269 | * RTX Errors |
mbed_official | 49:77c8e4604045 | 270 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 271 | extern void mbed_die(void); |
mbed_official | 49:77c8e4604045 | 272 | |
mbed_official | 49:77c8e4604045 | 273 | void os_error (uint32_t err_code) { |
mbed_official | 49:77c8e4604045 | 274 | /* This function is called when a runtime error is detected. Parameter */ |
mbed_official | 49:77c8e4604045 | 275 | /* 'err_code' holds the runtime error code (defined in RTX_Conf.h). */ |
mbed_official | 49:77c8e4604045 | 276 | mbed_die(); |
mbed_official | 49:77c8e4604045 | 277 | } |
mbed_official | 49:77c8e4604045 | 278 | |
mbed_official | 49:77c8e4604045 | 279 | void sysThreadError(osStatus status) { |
mbed_official | 49:77c8e4604045 | 280 | if (status != osOK) { |
mbed_official | 49:77c8e4604045 | 281 | mbed_die(); |
mbed_official | 49:77c8e4604045 | 282 | } |
mbed_official | 49:77c8e4604045 | 283 | } |
mbed_official | 49:77c8e4604045 | 284 | |
mbed_official | 49:77c8e4604045 | 285 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 286 | * RTX Configuration Functions |
mbed_official | 49:77c8e4604045 | 287 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 288 | |
mbed_official | 49:77c8e4604045 | 289 | #include "RTX_CM_lib.h" |
mbed_official | 49:77c8e4604045 | 290 | |
mbed_official | 49:77c8e4604045 | 291 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 292 | * end of file |
mbed_official | 49:77c8e4604045 | 293 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 294 |