ua_freeRTOS.h 1016 B

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