FreeRTOSConfig.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #pragma once
  2. #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
  3. #include <stdint.h>
  4. extern uint32_t SystemCoreClock;
  5. #endif
  6. #ifndef CMSIS_device_header
  7. #define CMSIS_device_header "stm32wbxx.h"
  8. #endif /* CMSIS_device_header */
  9. #define configENABLE_FPU 1
  10. #define configENABLE_MPU 0
  11. #define configUSE_PREEMPTION 1
  12. #define configSUPPORT_STATIC_ALLOCATION 0
  13. #define configSUPPORT_DYNAMIC_ALLOCATION 1
  14. #define configUSE_IDLE_HOOK 0
  15. #define configUSE_TICK_HOOK 0
  16. #define configCPU_CLOCK_HZ (SystemCoreClock)
  17. #define configTICK_RATE_HZ ((TickType_t)1000)
  18. #define configMAX_PRIORITIES (56)
  19. #define configMINIMAL_STACK_SIZE ((uint16_t)128)
  20. /* Heap size determined automatically by linker */
  21. // #define configTOTAL_HEAP_SIZE ((size_t)0)
  22. #define configMAX_TASK_NAME_LEN (16)
  23. #define configGENERATE_RUN_TIME_STATS 0
  24. #define configUSE_TRACE_FACILITY 1
  25. #define configUSE_16_BIT_TICKS 0
  26. #define configUSE_MUTEXES 1
  27. #define configQUEUE_REGISTRY_SIZE 8
  28. #define configCHECK_FOR_STACK_OVERFLOW 2
  29. #define configUSE_RECURSIVE_MUTEXES 1
  30. #define configUSE_COUNTING_SEMAPHORES 1
  31. #define configENABLE_BACKWARD_COMPATIBILITY 0
  32. #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
  33. #define configUSE_TICKLESS_IDLE 2
  34. #define configRECORD_STACK_HIGH_ADDRESS 1
  35. #define configUSE_NEWLIB_REENTRANT 0
  36. /* Defaults to size_t for backward compatibility, but can be changed
  37. if lengths will always be less than the number of bytes in a size_t. */
  38. #define configMESSAGE_BUFFER_LENGTH_TYPE size_t
  39. #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 1
  40. #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 4
  41. /* Co-routine definitions. */
  42. #define configUSE_CO_ROUTINES 0
  43. /* Software timer definitions. */
  44. #define configUSE_TIMERS 1
  45. #define configTIMER_TASK_PRIORITY (2)
  46. #define configTIMER_QUEUE_LENGTH 32
  47. #define configTIMER_TASK_STACK_DEPTH 256
  48. #define configTIMER_SERVICE_TASK_NAME "TimersSrv"
  49. #define configIDLE_TASK_NAME "(-_-)"
  50. /* Set the following definitions to 1 to include the API function, or zero
  51. to exclude the API function. */
  52. #define INCLUDE_xTaskGetHandle 1
  53. #define INCLUDE_eTaskGetState 1
  54. #define INCLUDE_uxTaskGetStackHighWaterMark 1
  55. #define INCLUDE_uxTaskPriorityGet 1
  56. #define INCLUDE_vTaskCleanUpResources 0
  57. #define INCLUDE_vTaskDelay 1
  58. #define INCLUDE_vTaskDelayUntil 1
  59. #define INCLUDE_vTaskDelete 1
  60. #define INCLUDE_vTaskPrioritySet 1
  61. #define INCLUDE_vTaskSuspend 1
  62. #define INCLUDE_xQueueGetMutexHolder 1
  63. #define INCLUDE_xTaskGetCurrentTaskHandle 1
  64. #define INCLUDE_xTaskGetSchedulerState 1
  65. #define INCLUDE_xTimerPendFunctionCall 1
  66. /* CMSIS-RTOS V2 flags */
  67. #define configUSE_OS2_THREAD_SUSPEND_RESUME 1
  68. #define configUSE_OS2_THREAD_ENUMERATE 1
  69. #define configUSE_OS2_THREAD_FLAGS 1
  70. #define configUSE_OS2_TIMER 1
  71. #define configUSE_OS2_MUTEX 1
  72. // NEVER TO BE USED, because of their hard realtime nature
  73. // #define configUSE_OS2_EVENTFLAGS_FROM_ISR 1
  74. /* CMSIS-RTOS */
  75. #define configTASK_NOTIFICATION_ARRAY_ENTRIES 2
  76. #define CMSIS_TASK_NOTIFY_INDEX 1
  77. /*
  78. * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used
  79. * by the application thus the correct define need to be enabled below
  80. */
  81. #define USE_FreeRTOS_HEAP_4
  82. /* Cortex-M specific definitions. */
  83. #ifdef __NVIC_PRIO_BITS
  84. /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
  85. #define configPRIO_BITS __NVIC_PRIO_BITS
  86. #else
  87. #define configPRIO_BITS 4
  88. #endif
  89. /* The lowest interrupt priority that can be used in a call to a "set priority"
  90. function. */
  91. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
  92. /* The highest interrupt priority that can be used by any interrupt service
  93. routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
  94. INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
  95. PRIORITY THAN THIS! (higher priorities are lower numeric values. */
  96. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
  97. /* Interrupt priorities used by the kernel port layer itself. These are generic
  98. to all Cortex-M ports, and do not rely on any particular library functions. */
  99. #define configKERNEL_INTERRUPT_PRIORITY \
  100. (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
  101. /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
  102. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
  103. #define configMAX_SYSCALL_INTERRUPT_PRIORITY \
  104. (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
  105. /* Normal assert() semantics without relying on the provision of an assert.h
  106. header file. */
  107. #ifdef DEBUG
  108. #include <furi/check.h>
  109. #define configASSERT(x) \
  110. if((x) == 0) { \
  111. furi_crash("FreeRTOS Assert"); \
  112. }
  113. #endif
  114. /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
  115. standard names. */
  116. #define vPortSVCHandler SVC_Handler
  117. #define xPortPendSVHandler PendSV_Handler
  118. #define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1
  119. #define configOVERRIDE_DEFAULT_TICK_CONFIGURATION \
  120. 1 /* required only for Keil but does not hurt otherwise */