open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
ua_freeRTOS.h
Go to the documentation of this file.
1/** This work is licensed under a Creative Commons CCZero 1.0 Universal License.
2 * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
3 *
4 * Copyright 2018 (c) Jose Cabral, fortiss GmbH
5 */
6
7#ifndef ARCH_COMMON_FREERTOS62541_H_
8#define ARCH_COMMON_FREERTOS62541_H_
9
10#include <stdlib.h>
11#include <string.h>
12
13#ifdef BYTE_ORDER
14# undef BYTE_ORDER
15#endif
16
17#define UA_sleep_ms(X) vTaskDelay(pdMS_TO_TICKS(X))
18
19#ifdef OPEN62541_FEERTOS_USE_OWN_MEM
20# define UA_free vPortFree
21# define UA_malloc pvPortMalloc
22# define UA_calloc pvPortCalloc
23# define UA_realloc pvPortRealloc
24#else
25# define UA_free free
26# define UA_malloc malloc
27# define UA_calloc calloc
28# define UA_realloc realloc
29#endif
30
31#ifdef UA_ENABLE_DISCOVERY_SEMAPHORE
32# ifndef UA_fileExists
33# define UA_fileExists(X) (0) //file managing is not part of freeRTOS. If the system provides it, please define it before
34# endif // UA_fileExists
35#endif
36
37// No log colors on freeRTOS
38// #define UA_ENABLE_LOG_COLORS
39
40#include <stdio.h>
41#define UA_snprintf snprintf
42
43#define UA_LOG_SOCKET_ERRNO_WRAP(LOG) { \
44 char *errno_str = ""; \
45 LOG; \
46}
47
48#endif /* ARCH_COMMON_FREERTOS62541_H_ */