FreeRTOSConfig.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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)1024)
  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 1
  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_EVENTFLAGS_FROM_ISR 1
  70. #define configUSE_OS2_THREAD_FLAGS 1
  71. #define configUSE_OS2_TIMER 1
  72. #define configUSE_OS2_MUTEX 1
  73. /* CMSIS-RTOS */
  74. #define configTASK_NOTIFICATION_ARRAY_ENTRIES 2
  75. #define CMSIS_TASK_NOTIFY_INDEX 1
  76. /*
  77. * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used
  78. * by the application thus the correct define need to be enabled below
  79. */
  80. #define USE_FreeRTOS_HEAP_4
  81. /* Cortex-M specific definitions. */
  82. #ifdef __NVIC_PRIO_BITS
  83. /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
  84. #define configPRIO_BITS __NVIC_PRIO_BITS
  85. #else
  86. #define configPRIO_BITS 4
  87. #endif
  88. /* The lowest interrupt priority that can be used in a call to a "set priority"
  89. function. */
  90. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
  91. /* The highest interrupt priority that can be used by any interrupt service
  92. routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
  93. INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
  94. PRIORITY THAN THIS! (higher priorities are lower numeric values. */
  95. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
  96. /* Interrupt priorities used by the kernel port layer itself. These are generic
  97. to all Cortex-M ports, and do not rely on any particular library functions. */
  98. #define configKERNEL_INTERRUPT_PRIORITY \
  99. (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
  100. /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
  101. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
  102. #define configMAX_SYSCALL_INTERRUPT_PRIORITY \
  103. (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
  104. /* Normal assert() semantics without relying on the provision of an assert.h
  105. header file. */
  106. #include <furi/check.h>
  107. #define configASSERT(x) \
  108. if((x) == 0) { \
  109. furi_crash("FreeRTOS Assert"); \
  110. }
  111. /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
  112. standard names. */
  113. #define vPortSVCHandler SVC_Handler
  114. #define xPortPendSVHandler PendSV_Handler
  115. #define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 1
  116. #define configOVERRIDE_DEFAULT_TICK_CONFIGURATION \
  117. 1 /* required only for Keil but does not hurt otherwise */