FreeRTOS.h
1 /*
2  * Copyright (C) 2019 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  *
8  * FreeRTOS to RIOT-OS adaption module for source code compatibility
9  */
10 
11 #ifndef FREERTOS_FREERTOS_H
12 #define FREERTOS_FREERTOS_H
13 
14 #ifndef DOXYGEN
15 
16 #include "freertos/portmacro.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1
23 #define configMAX_PRIORITIES SCHED_PRIO_LEVELS
24 
25 #ifndef configASSERT
26 #define configASSERT assert
27 #endif
28 
29 #define configTICK_RATE_HZ ((TickType_t)100)
30 
31 #define portTICK_PERIOD_MS 10
32 #define portTICK_RATE_MS portTICK_PERIOD_MS
33 
34 #define BaseType_t portBASE_TYPE
35 #define UBaseType_t portUBASE_TYPE
36 #define TickType_t portTICK_TYPE
37 #define StackType_t portSTACK_TYPE
38 
39 #define portTickType TickType_t
40 
41 #define pdMS_TO_TICKS(ms) ((TickType_t)(ms / portTICK_PERIOD_MS))
42 
43 #define xSemaphoreHandle SemaphoreHandle_t
44 
45 uint32_t xPortGetTickRateHz(void);
46 BaseType_t xPortInIsrContext(void);
47 
48 UBaseType_t xPortSetInterruptMaskFromISR(void);
49 void vPortClearInterruptMaskFromISR(UBaseType_t state);
50 
51 /*
52  * PLEASE NOTE: Following definitions were copied directly from the FreeRTOS
53  * distribution and are under the following copyright:
54  *
55  * FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.
56  * All rights reserved
57  *
58  * FreeRTOS is free software; you can redistribute it and/or modify it under
59  * the terms of the GNU General Public License (version 2) as published by the
60  * Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
61  *
62  * Full license text is available on the following
63  * link: http://www.freertos.org/a00114.html
64  */
65 
66 #define pdFALSE ( ( BaseType_t ) 0 )
67 #define pdTRUE ( ( BaseType_t ) 1 )
68 #define pdPASS ( pdTRUE )
69 #define pdFAIL ( pdFALSE )
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #include "freertos/semphr.h"
76 #include "freertos/queue.h"
77 
78 #endif /* DOXYGEN */
79 #endif /* FREERTOS_FREERTOS_H */