freeRTOS62541.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef ARCH_COMMON_FREERTOS62541_H_
  7. #define ARCH_COMMON_FREERTOS62541_H_
  8. #define UA_THREAD_LOCAL
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #ifdef BYTE_ORDER
  12. # undef BYTE_ORDER
  13. #endif
  14. #include <unistd.h> // read, write, close
  15. #define UA_sleep_ms(X) vTaskDelay(pdMS_TO_TICKS(X))
  16. #ifdef OPEN62541_FEERTOS_USE_OWN_MEM
  17. # define UA_free vPortFree
  18. # define UA_malloc pvPortMalloc
  19. # define UA_calloc pvPortCalloc
  20. # define UA_realloc pvPortRealloc
  21. #else
  22. # define UA_free free
  23. # define UA_malloc malloc
  24. # define UA_calloc calloc
  25. # define UA_realloc realloc
  26. #endif
  27. #define UA_access access
  28. // No log colors on freeRTOS
  29. // #define UA_ENABLE_LOG_COLORS
  30. #include <stdio.h>
  31. #define UA_snprintf snprintf
  32. #define UA_LOG_SOCKET_ERRNO_WRAP(LOG) { \
  33. char *errno_str = ""; \
  34. LOG; \
  35. }
  36. #define UA_LOG_SOCKET_ERRNO_GAI_WRAP UA_LOG_SOCKET_ERRNO_WRAP
  37. #endif /* ARCH_COMMON_FREERTOS62541_H_ */