ua_freeRTOS.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #define UA_sleep_ms(X) vTaskDelay(pdMS_TO_TICKS(X))
  14. #ifdef OPEN62541_FEERTOS_USE_OWN_MEM
  15. # define UA_free vPortFree
  16. # define UA_malloc pvPortMalloc
  17. # define UA_calloc pvPortCalloc
  18. # define UA_realloc pvPortRealloc
  19. #else
  20. # define UA_free free
  21. # define UA_malloc malloc
  22. # define UA_calloc calloc
  23. # define UA_realloc realloc
  24. #endif
  25. #ifdef UA_ENABLE_DISCOVERY_SEMAPHORE
  26. # ifndef UA_fileExists
  27. # define UA_fileExists(X) (0) //file managing is not part of freeRTOS. If the system provides it, please define it before
  28. # endif // UA_fileExists
  29. #endif
  30. // No log colors on freeRTOS
  31. // #define UA_ENABLE_LOG_COLORS
  32. #include <stdio.h>
  33. #define UA_snprintf snprintf
  34. #define UA_LOG_SOCKET_ERRNO_WRAP(LOG) { \
  35. char *errno_str = ""; \
  36. LOG; \
  37. }
  38. #endif /* ARCH_COMMON_FREERTOS62541_H_ */