VSF Documented
FreeRTOS.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// Clean-room FreeRTOS umbrella header shim for VSF.
19//
20// FreeRTOS applications include "FreeRTOS.h" before any other FreeRTOS
21// header. We expose the primitive types and configuration macros here so
22// that task.h / queue.h / semphr.h / timers.h / event_groups.h can be
23// included in any order.
24
25#ifndef __VSF_FREERTOS_H__
26#define __VSF_FREERTOS_H__
27
28// Pull in the VSF kernel so shim headers that expose their control blocks
29// as vsf_class (queue, semphr, task, timers, event_groups, stream_buffer)
30// have vsf_sem_t / vsf_mutex_t / vsf_eda_queue_t / vsf_bmpevt_t /
31// vsf_callback_timer_t / vsf_thread_t visible when they compute
32// sizeof(private_member(...)). The shim lives inside the VSF tree so any
33// consumer is a VSF user; FreeRTOS-style callers never touch the
34// transitively-leaked symbols.
35#include "kernel/vsf_kernel.h"
36
37// Pull in the shim's own config (VSF_FREERTOS_CFG_USE_NOTIFY /
38// VSF_FREERTOS_CFG_USE_TASK / ...) so that vsf_class-based control
39// blocks in task.h / queue.h / ... can pick up conditional members.
40// vsf_freertos_cfg.h lives one level above include/.
41#include "../vsf_freertos_cfg.h"
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47#include "portmacro.h"
48#include "portable.h"
49
50/*============================ CONFIG ========================================*/
51
52// Minimal stack budget. FreeRTOS calls that auto-allocate a stack use
53// multiples of this. In this shim StackType_t == uint8_t, so the unit is
54// byte. Users may override in project config.
55#ifndef configMINIMAL_STACK_SIZE
56# define configMINIMAL_STACK_SIZE ((uint16_t)1024)
57#endif
58
59// Number of FreeRTOS task priorities available. Mapping to VSF priorities
60// is flat by default (see freertos_task_port.c).
61#ifndef configMAX_PRIORITIES
62# define configMAX_PRIORITIES (25)
63#endif
64
65// TickType defaults mirror portmacro.h.
66#ifndef configTICK_RATE_HZ
67# define configTICK_RATE_HZ (1000)
68#endif
69
70#ifndef configUSE_16_BIT_TICKS
71# define configUSE_16_BIT_TICKS 0
72#endif
73
74// Tick->ms conversion. In this shim 1 tick == 1 ms so pdMS_TO_TICKS is the
75// identity; the underlying sleep still uses systimer ticks via vsf_thread.
76#define pdMS_TO_TICKS(xTimeInMs) ((TickType_t)(xTimeInMs))
77#define pdTICKS_TO_MS(xTicks) ((uint32_t)(xTicks))
78
79/*============================ ASSERT ========================================*/
80
81#ifndef configASSERT
82# define configASSERT(x) ((void)(x))
83#endif
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif // __VSF_FREERTOS_H__
Generated from commit: vsfteam/vsf@015f4d1