| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- /*
- * Copyright (c) 2013-2016 ARM Limited. All rights reserved.
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed under the Apache License, Version 2.0 (the License); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * -----------------------------------------------------------------------------
- *
- * $Revision: V5.0.0
- *
- * Project: CMSIS-RTOS RTX
- * Title: RTX Configuration
- *
- * -----------------------------------------------------------------------------
- */
-
- //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
-
- // <h>Thread Configuration
- // =======================
-
- // <e>Static Resources
- // <i> Enables static resources allocation.
- #define OS_THREAD_STATIC 0
-
- // <o>Number of user Threads (total) <1-1000>
- // <i> Defines maximum number of user threads that can be active at the same time.
- #define OS_THREAD_NUM 1
-
- // <o>Number of user Threads with user-provided Stack size <0-1000>
- // <i> Defines maximum number of user threads with user-provided stack size.
- // <i> Default: 0
- #define OS_THREAD_USER_STACK_NUM 0
-
- // </e>
-
- // <o>Default Thread Stack size [bytes] <96-1073741824:8>
- // <i> Defines stack size for threads with zero stack size specified.
- // <i> Default: 200
- #define OS_STACK_SIZE 200
-
- // <o>Idle Thread Stack size [bytes] <72-1073741824:8>
- // <i> Defines stack size for Idle thread.
- // <i> Default: 200
- #define OS_IDLE_THREAD_STACK_SIZE 200
-
- // <q>Stack overrun checking
- // <i> Enable stack overrun checks at thread switch.
- // <i> Enabling this option increases slightly the execution time of a thread switch.
- #define OS_STACK_CHECK 1
-
- // <q>Stack usage watermark
- // <i> Initialize thread stack with watermark pattern for analyzing stack usage.
- // <i> Enabling this option increases significantly the execution time of thread creation.
- #define OS_STACK_WATERMARK 0
-
- // <o>Processor mode for Thread execution
- // <0=> Unprivileged mode
- // <1=> Privileged mode
- // <i> Default: Privileged mode
- #define OS_PRIVILEGE_MODE 1
-
- // </h>
-
- // <h>Timer Configuration
- // ======================
-
- // <e>Static Resources
- // <i> Enables static resources allocation.
- #define OS_TIMER_STATIC 0
-
- // <o>Number of user Timers <1-1000>
- // <i> Defines maximum number of user timers that can be active at the same time.
- #define OS_TIMER_NUM 1
-
- // </e>
-
- // <o>Timer Thread Priority
- // <8=> Low
- // <16=> Below Normal <24=> Normal <32=> Above Normal
- // <40=> High
- // <48=> Realtime
- // <i> Defines priority for timer thread
- // <i> Default: High
- #define OS_TIMER_THREAD_PRIO 40
-
- // <o>Timer Thread Stack size [bytes] <0-1073741824:8>
- // <i> Defines stack size for Timer thread.
- // <i> May be set to 0 when timers are not used.
- // <i> Default: 200
- #define OS_TIMER_THREAD_STACK_SIZE 200
-
- // <o>Timer Callback Queue entries <0-256>
- // <i> Number of concurrent active timer callback functions.
- // <i> May be set to 0 when timers are not used.
- // <i> Default: 4
- #define OS_TIMER_CB_QUEUE 4
-
- // </h>
-
- // <h>Event Flags Configuration
- // ============================
-
- // <e>Static Resources
- // <i> Enables static resources allocation.
- #define OS_EVFLAGS_STATIC 0
-
- // <o>Number of Event Flags objects <1-1000>
- // <i> Defines maximum number of objects that can be active at the same time.
- #define OS_EVFLAGS_NUM 1
-
- // </e>
-
- // </h>
-
- // <h>Mutex Configuration
- // ======================
-
- // <e>Static Resources
- // <i> Enables static resources allocation.
- #define OS_MUTEX_STATIC 0
-
- // <o>Number of Mutex objects <1-1000>
- // <i> Defines maximum number of objects that can be active at the same time.
- #define OS_MUTEX_NUM 1
-
- // </e>
-
- // </h>
-
- // <h>Semaphore Configuration
- // ==========================
-
- // <e>Static Resources
- // <i> Enables static resources allocation.
- #define OS_SEMAPHORE_STATIC 0
-
- // <o>Number of Semaphore objects <1-1000>
- // <i> Defines maximum number of objects that can be active at the same time.
- #define OS_SEMAPHORE_NUM 1
-
- // </e>
-
- // </h>
-
- // <h>Memory Pool Configuration
- // ============================
-
- // <e>Static Resources
- // <i> Enables static resources allocation.
- #define OS_MEMPOOL_STATIC 0
-
- // <o>Number of Memory Pool objects <1-1000>
- // <i> Defines maximum number of objects that can be active at the same time.
- #define OS_MEMPOOL_NUM 1
-
- // </e>
-
- // </h>
-
- // <h>Message Queue Configuration
- // ==============================
-
- // <e>Static Resources
- // <i> Enables static resources allocation.
- #define OS_MSGQUEUE_STATIC 0
-
- // <o>Number of Message Queue objects <1-1000>
- // <i> Defines maximum number of objects that can be active at the same time.
- #define OS_MSGQUEUE_NUM 1
-
- // </e>
-
- // </h>
-
- // <h>System Configuration
- // =======================
-
- // <e>Dynamic Resources
- // <i> Enables dynamic resources allocation
- #define OS_DYNAMIC 0
-
- // <o>Memory size [bytes] for Control Blocks <0-1073741824:4>
- // <i> Defines the combined memory size for control blocks.
- // <i> Excluding objects with static resources.
- // <i> Default: 0
- #define OS_DYNAMIC_MEM_CB_SIZE 0
-
- // <o>Memory size [bytes] for Data Storage <0-1073741824:4>
- // <i> Defines the combined memory size for data storage (Memory Pool and Message Queue).
- // <i> Default: 0
- #define OS_DYNAMIC_MEM_DATA_SIZE 0
-
- // <o>Memory size [bytes] for Stack <0-1073741824:8>
- // <i> Defines the combined memory size for stack (Thread).
- // <i> Excluding threads with static resources and default stack size.
- // <i> Default: 0
- #define OS_DYNAMIC_MEM_STACK_SIZE 0
-
- // </e>
-
- // <o>Dynamic Memory size [bytes] <0-1073741824:8>
- // <i> Defines the combined dynamic memory size (excluding static and dynamic resources).
- // <i> Default: 4096
- #define OS_DYNAMIC_MEM_SIZE 4096
-
- // <e>Round-Robin Thread switching
- // <i> Enables Round-Robin Thread switching.
- #define OS_ROBIN_ENABLE 1
-
- // <o>Round-Robin Timeout [ms] <1-1000>
- // <i> Defines how long a thread will execute before a thread switch.
- // <i> Default: 5
- #define OS_ROBIN_TIMEOUT 5
-
- // </e>
-
- // <o>ISR FIFO Queue
- // <4=> 4 entries <8=> 8 entries <12=> 12 entries <16=> 16 entries
- // <24=> 24 entries <32=> 32 entries <48=> 48 entries <64=> 64 entries
- // <96=> 96 entries <128=> 128 entries <196=> 196 entries <256=> 256 entries
- // <i> RTOS Functions called from ISR store requests to this buffer.
- // <i> Default: 16 entries
- #define OS_ISR_FIFO_QUEUE 16
-
- // </h>
-
- // Number of Threads which use standard C/C++ library libspace
- // (when static thread resource allocation is not used).
- #if (OS_THREAD_STATIC == 0)
- #define OS_THREAD_LIBSPACE_NUM 4
- #else
- #define OS_THREAD_LIBSPACE_NUM OS_THREAD_NUM
- #endif
-
- //------------- <<< end of configuration section >>> ---------------------------
-
- #include "rtx_os.h"
-
- // OS Idle Thread
- void *os_IdleThread (void *argument) {
- (void)argument;
- for (;;) {}
- }
-
- // OS Error Callback function
- uint32_t os_Error (uint32_t code, void *object_id) {
- (void)object_id;
- switch (code) {
- case os_ErrorStackUnderflow:
- // Stack underflow detected for thread (thread_id=object_id)
- break;
- case os_ErrorISRQueueOverflow:
- // ISR Queue overflow detected when inserting object (object_id)
- break;
- case os_ErrorTimerQueueOverflow:
- // User Timer Callback Queue overflow detected for timer (timer_id=object_id)
- break;
- case os_ErrorClibSpace:
- // Standard C/C++ library libspace not available: increase OS_THREAD_LIBSPACE_NUM
- break;
- case os_ErrorClibMutex:
- // Standard C/C++ library mutex initialization failed
- break;
- default:
- break;
- }
- for (;;) {}
- //return 0U;
- }
-
- #include "rtx_config.h"
|