VSF Documented
vsf_freertos_cfg.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2026 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18/*============================ INCLUDES ======================================*/
19
21#include "../../../vsf_cfg.h"
22
23#ifndef __VSF_FREERTOS_CFG_H__
24#define __VSF_FREERTOS_CFG_H__
25
27
28/*============================ MACROS ========================================*/
29
30// Master switch. User enables this in vsf_usr_cfg.h / board cfg.
31#ifndef VSF_USE_FREERTOS
32# define VSF_USE_FREERTOS DISABLED
33#endif
34
35#ifndef VSF_FREERTOS_ASSERT
36# define VSF_FREERTOS_ASSERT VSF_ASSERT
37#endif
38
39#define VSF_FREERTOS_WRAPPER(__api) VSF_SHELL_WRAPPER(vsf_freertos, __api)
40
41// ---------------------------------------------------------------------------
42// FreeRTOS kernel baseline this sub-system targets. Aligned with ESP-IDF 5.x
43// bundled FreeRTOS (Amazon smp branch derived from v10.5.x).
44// ---------------------------------------------------------------------------
45#ifndef VSF_FREERTOS_CFG_VERSION_MAJOR
46# define VSF_FREERTOS_CFG_VERSION_MAJOR 10
47#endif
48#ifndef VSF_FREERTOS_CFG_VERSION_MINOR
49# define VSF_FREERTOS_CFG_VERSION_MINOR 5
50#endif
51#ifndef VSF_FREERTOS_CFG_VERSION_BUILD
52# define VSF_FREERTOS_CFG_VERSION_BUILD 0
53#endif
54
55// ---------------------------------------------------------------------------
56// Per-component enable switches. All OFF by default except the minimal
57// "task" primitives that other modules depend on.
58// ---------------------------------------------------------------------------
59#ifndef VSF_FREERTOS_CFG_USE_TASK
60# define VSF_FREERTOS_CFG_USE_TASK ENABLED
61#endif
62#ifndef VSF_FREERTOS_CFG_USE_QUEUE
63# define VSF_FREERTOS_CFG_USE_QUEUE ENABLED
64#endif
65#ifndef VSF_FREERTOS_CFG_USE_SEMPHR
66# define VSF_FREERTOS_CFG_USE_SEMPHR DISABLED
67#endif
68#ifndef VSF_FREERTOS_CFG_USE_TIMERS
69# define VSF_FREERTOS_CFG_USE_TIMERS DISABLED
70#endif
71#ifndef VSF_FREERTOS_CFG_USE_EVENT_GROUPS
72# define VSF_FREERTOS_CFG_USE_EVENT_GROUPS DISABLED
73#endif
74// Task notification primitives (xTaskNotify / ulTaskNotifyTake / ...).
75// Allocates one vsf_sem_t plus two words per task.
76#ifndef VSF_FREERTOS_CFG_USE_NOTIFY
77# define VSF_FREERTOS_CFG_USE_NOTIFY DISABLED
78#endif
79// Stream buffers + message buffers (xStreamBufferSend / xMessageBufferSend).
80#ifndef VSF_FREERTOS_CFG_USE_STREAM_BUFFER
81# define VSF_FREERTOS_CFG_USE_STREAM_BUFFER DISABLED
82#endif
83// Critical section & scheduler-suspend primitives
84// (vTaskEnterCritical / vTaskSuspendAll / portENTER_CRITICAL / ...).
85// portmacro.h unconditionally exposes the macros; this switch gates
86// the port implementation. Defaults to ENABLED because ESP-IDF code
87// heavily relies on taskENTER_CRITICAL() being callable.
88#ifndef VSF_FREERTOS_CFG_USE_CRITICAL
89# define VSF_FREERTOS_CFG_USE_CRITICAL ENABLED
90#endif
91
92// Default priority used when FreeRTOS task priorities are mapped to VSF
93// priorities. FreeRTOS priorities are numerical (0..configMAX_PRIORITIES-1)
94// while VSF uses enum (vsf_prio_0 .. vsf_prio_N). The shim maps any FreeRTOS
95// priority to VSF_FREERTOS_CFG_DEFAULT_VSF_PRIO by default; boards can
96// override for a more nuanced mapping.
97#ifndef VSF_FREERTOS_CFG_DEFAULT_VSF_PRIO
98# define VSF_FREERTOS_CFG_DEFAULT_VSF_PRIO vsf_prio_0
99#endif
100
101// Default stack size (in StackType_t units, which we define as uint8_t to
102// match byte-sized budgets) when xTaskCreate is asked to allocate its own
103// stack. Used for diagnostics only; the real allocation is byte-sized.
104#ifndef VSF_FREERTOS_CFG_MIN_STACK_BYTES
105# define VSF_FREERTOS_CFG_MIN_STACK_BYTES 1024
106#endif
107
108#endif // __VSF_FREERTOS_CFG_H__
Generated from commit: vsfteam/vsf@015f4d1