Nummer 0.1 Werkt nog niet volledig
Fork of mbed-rtos by
rtx/TARGET_CORTEX_M/RTX_Conf_CM.c@109:f37e70028583, 2016-05-13 (annotated)
- Committer:
- Reynier
- Date:
- Fri May 13 21:42:20 2016 +0000
- Revision:
- 109:f37e70028583
- Parent:
- 107:bdd541595fc5
Alles zonder werkende NRF
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 | 64:ab4200083b07 | 52 | # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM) || defined(TARGET_LPC4330) || defined(TARGET_LPC4337) || defined(TARGET_LPC1347) || defined(TARGET_K64F) || defined(TARGET_STM32F401RE)\ |
mbed_official | 97:6c35e082773a | 53 | || defined(TARGET_STM32F410RB) || defined(TARGET_KL46Z) || defined(TARGET_KL43Z) || defined(TARGET_STM32F407) || defined(TARGET_F407VG) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_LPC11U68) \ |
mbed_official | 79:c586ffeebfb4 | 54 | || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F401VC) || defined(TARGET_MAX32610) || defined(TARGET_MAX32600) || defined(TARGET_TEENSY3_1) \ |
mbed_official | 105:b4c5542476ba | 55 | || defined(TARGET_STM32L152RE) || defined(TARGET_STM32F446RE) || defined(TARGET_STM32F446VE) || defined(TARGET_STM32L476VG) || defined(TARGET_STM32L476RG) || defined(TARGET_STM32F469NI) || defined(TARGET_STM32F746NG) || defined(TARGET_STM32F746ZG) || defined(TARGET_STM32L152RC) |
mbed_official | 49:77c8e4604045 | 56 | # define OS_TASKCNT 14 |
mbed_official | 95:12552ef4e980 | 57 | # elif defined(TARGET_LPC11U24) || defined(TARGET_STM32F303RE) || defined(TARGET_STM32F303K8) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO) || defined(TARGET_LPC1114) \ |
mbed_official | 88:a21475017ae2 | 58 | || defined(TARGET_LPC812) || defined(TARGET_KL25Z) || defined(TARGET_KL26Z) || defined(TARGET_KL05Z) || defined(TARGET_STM32F100RB) || defined(TARGET_STM32F051R8) \ |
mbed_official | 59:28712e303960 | 59 | || defined(TARGET_STM32F103RB) || defined(TARGET_LPC824) || defined(TARGET_STM32F302R8) || defined(TARGET_STM32F334R8) || defined(TARGET_STM32F334C8) \ |
mbed_official | 106:dfc27975e193 | 60 | || defined(TARGET_STM32L053R8) || defined(TARGET_STM32L053C8) || defined(TARGET_STM32L073RZ) || defined(TARGET_STM32F072RB) || defined(TARGET_STM32F091RC) || defined(TARGET_NZ32_SC151) \ |
mbed_official | 87:e695cd34556b | 61 | || defined(TARGET_SSCI824) || defined(TARGET_STM32F030R8) || defined(TARGET_STM32F070RB) |
mbed_official | 49:77c8e4604045 | 62 | # define OS_TASKCNT 6 |
mbed_official | 49:77c8e4604045 | 63 | # else |
mbed_official | 49:77c8e4604045 | 64 | # error "no target defined" |
mbed_official | 49:77c8e4604045 | 65 | # endif |
mbed_official | 49:77c8e4604045 | 66 | #endif |
mbed_official | 49:77c8e4604045 | 67 | |
mbed_official | 49:77c8e4604045 | 68 | // <o>Scheduler (+ interrupts) stack size [bytes] <64-4096:8><#/4> |
mbed_official | 49:77c8e4604045 | 69 | #ifndef OS_SCHEDULERSTKSIZE |
mbed_official | 64:ab4200083b07 | 70 | # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM) || defined(TARGET_LPC4330) || defined(TARGET_LPC4337) || defined(TARGET_LPC1347) || defined(TARGET_K64F) || defined(TARGET_STM32F401RE)\ |
mbed_official | 97:6c35e082773a | 71 | || defined(TARGET_STM32F410RB) || defined(TARGET_KL46Z) || defined(TARGET_KL43Z) || defined(TARGET_STM32F407) || defined(TARGET_F407VG) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_LPC11U68) \ |
mbed_official | 79:c586ffeebfb4 | 72 | || defined(TARGET_STM32F411RE) || defined(TARGET_STM32F405RG) || defined(TARGET_K22F) || defined(TARGET_STM32F429ZI) || defined(TARGET_STM32F401VC) || defined(TARGET_MAX32610) || defined(TARGET_MAX32600) || defined(TARGET_TEENSY3_1) \ |
mbed_official | 105:b4c5542476ba | 73 | || defined(TARGET_STM32L152RE) || defined(TARGET_STM32F446RE) || defined(TARGET_STM32F446VE) || defined(TARGET_STM32L476VG) || defined(TARGET_STM32L476RG) || defined(TARGET_STM32F469NI) || defined(TARGET_STM32F746NG) || defined(TARGET_STM32F746ZG) || defined(TARGET_STM32L152RC) |
mbed_official | 49:77c8e4604045 | 74 | # define OS_SCHEDULERSTKSIZE 256 |
mbed_official | 49:77c8e4604045 | 75 | # elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO) || defined(TARGET_LPC1114) \ |
mbed_official | 88:a21475017ae2 | 76 | || defined(TARGET_LPC812) || defined(TARGET_KL25Z) || defined(TARGET_KL26Z) || defined(TARGET_KL05Z) || defined(TARGET_STM32F100RB) || defined(TARGET_STM32F051R8) \ |
mbed_official | 104:07314541bd12 | 77 | || defined(TARGET_STM32F103RB) || defined(TARGET_LPC824) || defined(TARGET_STM32F302R8) || defined(TARGET_STM32F072RB) || defined(TARGET_STM32F091RC) || defined(TARGET_NZ32_SC151) \ |
mbed_official | 87:e695cd34556b | 78 | || defined(TARGET_SSCI824) || defined(TARGET_STM32F030R8) || defined(TARGET_STM32F070RB) |
mbed_official | 49:77c8e4604045 | 79 | # define OS_SCHEDULERSTKSIZE 128 |
mbed_official | 106:dfc27975e193 | 80 | # elif defined(TARGET_STM32F334R8) || defined(TARGET_STM32F303RE) || defined(TARGET_STM32F303K8) || defined(TARGET_STM32F334C8) || defined(TARGET_STM32L053R8) || defined(TARGET_STM32L053C8) || defined(TARGET_STM32L073RZ) |
mbed_official | 59:28712e303960 | 81 | # define OS_SCHEDULERSTKSIZE 112 |
mbed_official | 49:77c8e4604045 | 82 | # else |
mbed_official | 49:77c8e4604045 | 83 | # error "no target defined" |
mbed_official | 49:77c8e4604045 | 84 | # endif |
mbed_official | 49:77c8e4604045 | 85 | #endif |
mbed_official | 49:77c8e4604045 | 86 | |
mbed_official | 49:77c8e4604045 | 87 | // <o>Idle stack size [bytes] <64-4096:8><#/4> |
mbed_official | 49:77c8e4604045 | 88 | // <i> Defines default stack size for the Idle thread. |
mbed_official | 49:77c8e4604045 | 89 | #ifndef OS_IDLESTKSIZE |
mbed_official | 49:77c8e4604045 | 90 | #define OS_IDLESTKSIZE 128 |
mbed_official | 49:77c8e4604045 | 91 | #endif |
mbed_official | 49:77c8e4604045 | 92 | |
mbed_official | 49:77c8e4604045 | 93 | // <o>Timer Thread stack size [bytes] <64-4096:8><#/4> |
mbed_official | 49:77c8e4604045 | 94 | // <i> Defines stack size for Timer thread. |
mbed_official | 49:77c8e4604045 | 95 | // <i> Default: 200 |
mbed_official | 49:77c8e4604045 | 96 | #ifndef OS_TIMERSTKSZ |
mbed_official | 49:77c8e4604045 | 97 | #define OS_TIMERSTKSZ WORDS_STACK_SIZE |
mbed_official | 49:77c8e4604045 | 98 | #endif |
mbed_official | 49:77c8e4604045 | 99 | |
mbed_official | 49:77c8e4604045 | 100 | // <q>Check for stack overflow |
mbed_official | 49:77c8e4604045 | 101 | // <i> Includes the stack checking code for stack overflow. |
mbed_official | 49:77c8e4604045 | 102 | // <i> Note that additional code reduces the Kernel performance. |
mbed_official | 49:77c8e4604045 | 103 | #ifndef OS_STKCHECK |
mbed_official | 49:77c8e4604045 | 104 | #define OS_STKCHECK 1 |
mbed_official | 49:77c8e4604045 | 105 | #endif |
mbed_official | 49:77c8e4604045 | 106 | |
mbed_official | 49:77c8e4604045 | 107 | // <o>Processor mode for thread execution |
mbed_official | 49:77c8e4604045 | 108 | // <0=> Unprivileged mode |
mbed_official | 49:77c8e4604045 | 109 | // <1=> Privileged mode |
mbed_official | 49:77c8e4604045 | 110 | // <i> Default: Privileged mode |
mbed_official | 49:77c8e4604045 | 111 | #ifndef OS_RUNPRIV |
mbed_official | 49:77c8e4604045 | 112 | #define OS_RUNPRIV 1 |
mbed_official | 49:77c8e4604045 | 113 | #endif |
mbed_official | 49:77c8e4604045 | 114 | |
mbed_official | 49:77c8e4604045 | 115 | // </h> |
mbed_official | 49:77c8e4604045 | 116 | // <h>SysTick Timer Configuration |
mbed_official | 49:77c8e4604045 | 117 | // ============================== |
mbed_official | 49:77c8e4604045 | 118 | // |
mbed_official | 49:77c8e4604045 | 119 | // <o>Timer clock value [Hz] <1-1000000000> |
mbed_official | 49:77c8e4604045 | 120 | // <i> Defines the timer clock value. |
mbed_official | 49:77c8e4604045 | 121 | // <i> Default: 6000000 (6MHz) |
mbed_official | 49:77c8e4604045 | 122 | #ifndef OS_CLOCK |
mbed_official | 102:f62a48e9da94 | 123 | # if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_TEENSY3_1) |
mbed_official | 49:77c8e4604045 | 124 | # define OS_CLOCK 96000000 |
mbed_official | 49:77c8e4604045 | 125 | |
mbed_official | 102:f62a48e9da94 | 126 | # elif defined(TARGET_LPC1347) || defined(TARGET_STM32F303VC) || defined(TARGET_LPC1549) || defined(TARGET_STM32F334R8) || defined(TARGET_STM32F334C8) || defined(TARGET_STM32F303RE) |
mbed_official | 49:77c8e4604045 | 127 | # define OS_CLOCK 72000000 |
mbed_official | 49:77c8e4604045 | 128 | |
mbed_official | 95:12552ef4e980 | 129 | # elif defined(TARGET_STM32F303K8) |
mbed_official | 95:12552ef4e980 | 130 | # define OS_CLOCK 64000000 |
mbed_official | 95:12552ef4e980 | 131 | |
mbed_official | 59:28712e303960 | 132 | # elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) || defined(TARGET_LPC11U35_501) || defined(TARGET_LPCCAPPUCCINO) || defined(TARGET_LPC1114) || defined(TARGET_KL25Z) \ |
mbed_official | 88:a21475017ae2 | 133 | || defined(TARGET_KL26Z) || defined(TARGET_KL05Z) || defined(TARGET_KL46Z) || defined(TARGET_KL43Z) || defined(TARGET_STM32F051R8) || defined(TARGET_LPC11U68) || defined(TARGET_STM32F072RB) || defined(TARGET_STM32F091RC) |
mbed_official | 49:77c8e4604045 | 134 | # define OS_CLOCK 48000000 |
mbed_official | 49:77c8e4604045 | 135 | |
mbed_official | 49:77c8e4604045 | 136 | # elif defined(TARGET_LPC812) |
mbed_official | 49:77c8e4604045 | 137 | # define OS_CLOCK 36000000 |
mbed_official | 49:77c8e4604045 | 138 | |
mbed_official | 81:e45e4ac7c3c8 | 139 | # elif defined(TARGET_LPC824) || defined(TARGET_SSCI824) |
mbed_official | 49:77c8e4604045 | 140 | # define OS_CLOCK 30000000 |
mbed_official | 49:77c8e4604045 | 141 | |
mbed_official | 49:77c8e4604045 | 142 | # elif defined(TARGET_STM32F100RB) |
mbed_official | 49:77c8e4604045 | 143 | # define OS_CLOCK 24000000 |
mbed_official | 49:77c8e4604045 | 144 | |
mbed_official | 64:ab4200083b07 | 145 | # elif defined(TARGET_LPC4088) || defined(TARGET_LPC4088_DM) || defined(TARGET_K64F) || defined(TARGET_K22F) |
mbed_official | 49:77c8e4604045 | 146 | # define OS_CLOCK 120000000 |
mbed_official | 49:77c8e4604045 | 147 | |
mbed_official | 63:5448826aa700 | 148 | # elif defined(TARGET_LPC4330) |
mbed_official | 63:5448826aa700 | 149 | # define OS_CLOCK 204000000 |
mbed_official | 63:5448826aa700 | 150 | |
mbed_official | 49:77c8e4604045 | 151 | # elif defined(TARGET_LPC4337) |
mbed_official | 49:77c8e4604045 | 152 | # define OS_CLOCK 204000000 |
mbed_official | 49:77c8e4604045 | 153 | |
mbed_official | 49:77c8e4604045 | 154 | # elif defined(TARGET_STM32F407) || defined(TARGET_F407VG) |
mbed_official | 49:77c8e4604045 | 155 | # define OS_CLOCK 168000000 |
mbed_official | 49:77c8e4604045 | 156 | |
mbed_official | 49:77c8e4604045 | 157 | # elif defined(TARGET_STM32F401RE) |
mbed_official | 49:77c8e4604045 | 158 | # define OS_CLOCK 84000000 |
mbed_official | 49:77c8e4604045 | 159 | |
mbed_official | 49:77c8e4604045 | 160 | # elif defined(TARGET_STM32F411RE) |
mbed_official | 49:77c8e4604045 | 161 | # define OS_CLOCK 100000000 |
mbed_official | 49:77c8e4604045 | 162 | |
mbed_official | 97:6c35e082773a | 163 | # elif defined(TARGET_STM32F410RB) |
mbed_official | 97:6c35e082773a | 164 | # define OS_CLOCK 100000000 |
mbed_official | 97:6c35e082773a | 165 | |
mbed_official | 78:2db19f47c2ba | 166 | #elif defined(TARGET_STM32F103RB) |
mbed_official | 49:77c8e4604045 | 167 | # define OS_CLOCK 72000000 |
mbed_official | 49:77c8e4604045 | 168 | |
mbed_official | 57:430de2831ec7 | 169 | #elif defined(TARGET_STM32F429ZI) |
mbed_official | 58:13a25134ac60 | 170 | # define OS_CLOCK 168000000 |
mbed_official | 57:430de2831ec7 | 171 | |
mbed_official | 59:28712e303960 | 172 | #elif defined(TARGET_STM32F302R8) |
mbed_official | 75:557d5b275f31 | 173 | # define OS_CLOCK 72000000 |
mbed_official | 59:28712e303960 | 174 | |
mbed_official | 106:dfc27975e193 | 175 | #elif defined(TARGET_STM32L053R8) || defined(TARGET_STM32L053C8) || defined(TARGET_STM32L073RZ) |
mbed_official | 59:28712e303960 | 176 | # define OS_CLOCK 32000000 |
mbed_official | 59:28712e303960 | 177 | |
mbed_official | 60:f4d3d8971bc3 | 178 | #elif defined(TARGET_STM32F401VC) |
mbed_official | 60:f4d3d8971bc3 | 179 | # define OS_CLOCK 84000000 |
mbed_official | 60:f4d3d8971bc3 | 180 | |
mbed_official | 105:b4c5542476ba | 181 | # elif defined(TARGET_STM32F746NG) || defined(TARGET_STM32F746ZG) |
mbed_official | 98:c825593ece39 | 182 | # define OS_CLOCK 216000000 |
mbed_official | 98:c825593ece39 | 183 | |
mbed_official | 73:34292fba723c | 184 | #elif defined(TARGET_MAX32610) || defined(TARGET_MAX32600) |
mbed_official | 71:570e569a5b59 | 185 | # define OS_CLOCK 24000000 |
mbed_official | 71:570e569a5b59 | 186 | |
mbed_official | 104:07314541bd12 | 187 | #elif defined(TARGET_NZ32_SC151) |
mbed_official | 78:2db19f47c2ba | 188 | # define OS_CLOCK 32000000 |
mbed_official | 78:2db19f47c2ba | 189 | |
mbed_official | 78:2db19f47c2ba | 190 | #elif defined(TARGET_STM32L152RE) |
mbed_official | 78:2db19f47c2ba | 191 | # define OS_CLOCK 24000000 |
mbed_official | 78:2db19f47c2ba | 192 | |
mbed_official | 100:c837dbc4020a | 193 | #elif (defined(TARGET_STM32F446RE) || defined(TARGET_STM32F446VE)) |
mbed_official | 79:c586ffeebfb4 | 194 | # define OS_CLOCK 180000000 |
mbed_official | 79:c586ffeebfb4 | 195 | |
mbed_official | 87:e695cd34556b | 196 | #elif defined(TARGET_STM32F030R8) |
mbed_official | 87:e695cd34556b | 197 | # define OS_CLOCK 48000000 |
mbed_official | 87:e695cd34556b | 198 | |
mbed_official | 87:e695cd34556b | 199 | #elif defined(TARGET_STM32F070RB) |
mbed_official | 87:e695cd34556b | 200 | # define OS_CLOCK 48000000 |
mbed_official | 79:c586ffeebfb4 | 201 | |
mbed_official | 91:9d001ed5feec | 202 | #elif defined(TARGET_STM32L476VG) || defined(TARGET_STM32L476RG) |
mbed_official | 91:9d001ed5feec | 203 | # define OS_CLOCK 80000000 |
mbed_official | 91:9d001ed5feec | 204 | |
mbed_official | 96:6d90423c236e | 205 | #elif defined(TARGET_STM32F469NI) |
mbed_official | 96:6d90423c236e | 206 | # define OS_CLOCK 168000000 |
mbed_official | 96:6d90423c236e | 207 | |
mbed_official | 99:79d2f32f753f | 208 | #elif defined(TARGET_STM32L152RC) |
mbed_official | 99:79d2f32f753f | 209 | # define OS_CLOCK 24000000 |
mbed_official | 99:79d2f32f753f | 210 | |
mbed_official | 49:77c8e4604045 | 211 | # else |
mbed_official | 49:77c8e4604045 | 212 | # error "no target defined" |
mbed_official | 49:77c8e4604045 | 213 | # endif |
mbed_official | 49:77c8e4604045 | 214 | #endif |
mbed_official | 49:77c8e4604045 | 215 | |
mbed_official | 49:77c8e4604045 | 216 | // <o>Timer tick value [us] <1-1000000> |
mbed_official | 49:77c8e4604045 | 217 | // <i> Defines the timer tick value. |
mbed_official | 49:77c8e4604045 | 218 | // <i> Default: 1000 (1ms) |
mbed_official | 49:77c8e4604045 | 219 | #ifndef OS_TICK |
mbed_official | 49:77c8e4604045 | 220 | #define OS_TICK 1000 |
mbed_official | 49:77c8e4604045 | 221 | #endif |
mbed_official | 49:77c8e4604045 | 222 | |
mbed_official | 49:77c8e4604045 | 223 | // </h> |
mbed_official | 49:77c8e4604045 | 224 | |
mbed_official | 49:77c8e4604045 | 225 | // <h>System Configuration |
mbed_official | 49:77c8e4604045 | 226 | // ======================= |
mbed_official | 49:77c8e4604045 | 227 | // |
mbed_official | 49:77c8e4604045 | 228 | // <e>Round-Robin Thread switching |
mbed_official | 49:77c8e4604045 | 229 | // =============================== |
mbed_official | 49:77c8e4604045 | 230 | // |
mbed_official | 49:77c8e4604045 | 231 | // <i> Enables Round-Robin Thread switching. |
mbed_official | 49:77c8e4604045 | 232 | #ifndef OS_ROBIN |
mbed_official | 49:77c8e4604045 | 233 | #define OS_ROBIN 1 |
mbed_official | 49:77c8e4604045 | 234 | #endif |
mbed_official | 49:77c8e4604045 | 235 | |
mbed_official | 49:77c8e4604045 | 236 | // <o>Round-Robin Timeout [ticks] <1-1000> |
mbed_official | 49:77c8e4604045 | 237 | // <i> Defines how long a thread will execute before a thread switch. |
mbed_official | 49:77c8e4604045 | 238 | // <i> Default: 5 |
mbed_official | 49:77c8e4604045 | 239 | #ifndef OS_ROBINTOUT |
mbed_official | 49:77c8e4604045 | 240 | #define OS_ROBINTOUT 5 |
mbed_official | 49:77c8e4604045 | 241 | #endif |
mbed_official | 49:77c8e4604045 | 242 | |
mbed_official | 49:77c8e4604045 | 243 | // </e> |
mbed_official | 49:77c8e4604045 | 244 | |
mbed_official | 49:77c8e4604045 | 245 | // <e>User Timers |
mbed_official | 49:77c8e4604045 | 246 | // ============== |
mbed_official | 49:77c8e4604045 | 247 | // <i> Enables user Timers |
mbed_official | 49:77c8e4604045 | 248 | #ifndef OS_TIMERS |
mbed_official | 49:77c8e4604045 | 249 | #define OS_TIMERS 1 |
mbed_official | 49:77c8e4604045 | 250 | #endif |
mbed_official | 49:77c8e4604045 | 251 | |
mbed_official | 49:77c8e4604045 | 252 | // <o>Timer Thread Priority |
mbed_official | 49:77c8e4604045 | 253 | // <1=> Low |
mbed_official | 49:77c8e4604045 | 254 | // <2=> Below Normal |
mbed_official | 49:77c8e4604045 | 255 | // <3=> Normal |
mbed_official | 49:77c8e4604045 | 256 | // <4=> Above Normal |
mbed_official | 49:77c8e4604045 | 257 | // <5=> High |
mbed_official | 49:77c8e4604045 | 258 | // <6=> Realtime (highest) |
mbed_official | 49:77c8e4604045 | 259 | // <i> Defines priority for Timer Thread |
mbed_official | 49:77c8e4604045 | 260 | // <i> Default: High |
mbed_official | 49:77c8e4604045 | 261 | #ifndef OS_TIMERPRIO |
mbed_official | 49:77c8e4604045 | 262 | #define OS_TIMERPRIO 5 |
mbed_official | 49:77c8e4604045 | 263 | #endif |
mbed_official | 49:77c8e4604045 | 264 | |
mbed_official | 49:77c8e4604045 | 265 | // <o>Timer Callback Queue size <1-32> |
mbed_official | 49:77c8e4604045 | 266 | // <i> Number of concurrent active timer callback functions. |
mbed_official | 49:77c8e4604045 | 267 | // <i> Default: 4 |
mbed_official | 49:77c8e4604045 | 268 | #ifndef OS_TIMERCBQSZ |
mbed_official | 49:77c8e4604045 | 269 | #define OS_TIMERCBQS 4 |
mbed_official | 49:77c8e4604045 | 270 | #endif |
mbed_official | 49:77c8e4604045 | 271 | |
mbed_official | 49:77c8e4604045 | 272 | // </e> |
mbed_official | 49:77c8e4604045 | 273 | |
mbed_official | 49:77c8e4604045 | 274 | // <o>ISR FIFO Queue size<4=> 4 entries <8=> 8 entries |
mbed_official | 49:77c8e4604045 | 275 | // <12=> 12 entries <16=> 16 entries |
mbed_official | 49:77c8e4604045 | 276 | // <24=> 24 entries <32=> 32 entries |
mbed_official | 49:77c8e4604045 | 277 | // <48=> 48 entries <64=> 64 entries |
mbed_official | 49:77c8e4604045 | 278 | // <96=> 96 entries |
mbed_official | 49:77c8e4604045 | 279 | // <i> ISR functions store requests to this buffer, |
mbed_official | 49:77c8e4604045 | 280 | // <i> when they are called from the interrupt handler. |
mbed_official | 49:77c8e4604045 | 281 | // <i> Default: 16 entries |
mbed_official | 49:77c8e4604045 | 282 | #ifndef OS_FIFOSZ |
mbed_official | 49:77c8e4604045 | 283 | #define OS_FIFOSZ 16 |
mbed_official | 49:77c8e4604045 | 284 | #endif |
mbed_official | 49:77c8e4604045 | 285 | |
mbed_official | 49:77c8e4604045 | 286 | // </h> |
mbed_official | 49:77c8e4604045 | 287 | |
mbed_official | 49:77c8e4604045 | 288 | //------------- <<< end of configuration section >>> ----------------------- |
mbed_official | 49:77c8e4604045 | 289 | |
mbed_official | 49:77c8e4604045 | 290 | // Standard library system mutexes |
mbed_official | 49:77c8e4604045 | 291 | // =============================== |
mbed_official | 49:77c8e4604045 | 292 | // Define max. number system mutexes that are used to protect |
mbed_official | 49:77c8e4604045 | 293 | // the arm standard runtime library. For microlib they are not used. |
mbed_official | 49:77c8e4604045 | 294 | #ifndef OS_MUTEXCNT |
mbed_official | 49:77c8e4604045 | 295 | #define OS_MUTEXCNT 12 |
mbed_official | 49:77c8e4604045 | 296 | #endif |
mbed_official | 49:77c8e4604045 | 297 | |
mbed_official | 49:77c8e4604045 | 298 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 299 | * RTX User configuration part END |
mbed_official | 49:77c8e4604045 | 300 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 301 | |
mbed_official | 49:77c8e4604045 | 302 | #define OS_TRV ((uint32_t)(((double)OS_CLOCK*(double)OS_TICK)/1E6)-1) |
mbed_official | 49:77c8e4604045 | 303 | |
mbed_official | 49:77c8e4604045 | 304 | |
mbed_official | 49:77c8e4604045 | 305 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 306 | * OS Idle daemon |
mbed_official | 49:77c8e4604045 | 307 | *---------------------------------------------------------------------------*/ |
mbed_official | 107:bdd541595fc5 | 308 | extern void rtos_idle_loop(void); |
mbed_official | 49:77c8e4604045 | 309 | |
mbed_official | 107:bdd541595fc5 | 310 | void os_idle_demon (void) { |
mbed_official | 107:bdd541595fc5 | 311 | /* The idle demon is a system thread, running when no other thread is */ |
mbed_official | 107:bdd541595fc5 | 312 | /* ready to run. */ |
mbed_official | 107:bdd541595fc5 | 313 | rtos_idle_loop(); |
mbed_official | 49:77c8e4604045 | 314 | } |
mbed_official | 49:77c8e4604045 | 315 | |
mbed_official | 49:77c8e4604045 | 316 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 317 | * RTX Errors |
mbed_official | 49:77c8e4604045 | 318 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 319 | extern void mbed_die(void); |
mbed_official | 49:77c8e4604045 | 320 | |
mbed_official | 49:77c8e4604045 | 321 | void os_error (uint32_t err_code) { |
mbed_official | 49:77c8e4604045 | 322 | /* This function is called when a runtime error is detected. Parameter */ |
mbed_official | 49:77c8e4604045 | 323 | /* 'err_code' holds the runtime error code (defined in RTX_Conf.h). */ |
mbed_official | 49:77c8e4604045 | 324 | mbed_die(); |
mbed_official | 49:77c8e4604045 | 325 | } |
mbed_official | 49:77c8e4604045 | 326 | |
mbed_official | 49:77c8e4604045 | 327 | void sysThreadError(osStatus status) { |
mbed_official | 49:77c8e4604045 | 328 | if (status != osOK) { |
mbed_official | 49:77c8e4604045 | 329 | mbed_die(); |
mbed_official | 49:77c8e4604045 | 330 | } |
mbed_official | 49:77c8e4604045 | 331 | } |
mbed_official | 49:77c8e4604045 | 332 | |
mbed_official | 49:77c8e4604045 | 333 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 334 | * RTX Configuration Functions |
mbed_official | 49:77c8e4604045 | 335 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 336 | |
mbed_official | 49:77c8e4604045 | 337 | #include "RTX_CM_lib.h" |
mbed_official | 49:77c8e4604045 | 338 | |
mbed_official | 49:77c8e4604045 | 339 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 340 | * end of file |
mbed_official | 49:77c8e4604045 | 341 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 342 |