Skip to content

Commit e393545

Browse files
committed
add FreeRTOS conversion definition by moving from mros2-mbed
1 parent 96a2615 commit e393545

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

include/mros2/freertos_conversion.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Conversion of FreeRTOS's definitions/types/functions in embeddedRTPS
3+
*
4+
* Copyright (c) 2022 mROS-base
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#ifndef RTPS_CONVERSION_H
20+
#define RTPS_CONVERSION_H
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
#include <stdint.h>
26+
typedef uint32_t TickType_t;
27+
#define configTICK_RATE_HZ ((TickType_t)1000)
28+
29+
#ifndef pdMS_TO_TICKS
30+
#define pdMS_TO_TICKS(xTimeInMs) ((TickType_t)(((TickType_t)(xTimeInMs) * (TickType_t)configTICK_RATE_HZ) / (TickType_t)1000))
31+
#endif
32+
33+
#define xTaskGetTickCount osKernelGetTickCount
34+
#define vTaskDelay osDelay
35+
36+
void sys_msleep(unsigned int ms);
37+
#ifdef __cplusplus
38+
}
39+
#endif
40+
41+
#endif /* RTPS_CONVERSION_H */

0 commit comments

Comments
 (0)