FreeRTOSConfig.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /* USER CODE BEGIN Header */
  2. /*
  3. * FreeRTOS Kernel V10.0.1
  4. * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  7. * this software and associated documentation files (the "Software"), to deal in
  8. * the Software without restriction, including without limitation the rights to
  9. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  10. * the Software, and to permit persons to whom the Software is furnished to do so,
  11. * subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in all
  14. * copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  18. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  19. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. *
  23. * http://www.FreeRTOS.org
  24. * http://aws.amazon.com/freertos
  25. *
  26. * 1 tab == 4 spaces!
  27. */
  28. /* USER CODE END Header */
  29. #ifndef FREERTOS_CONFIG_H
  30. #define FREERTOS_CONFIG_H
  31. /*-----------------------------------------------------------
  32. * Application specific definitions.
  33. *
  34. * These definitions should be adjusted for your particular hardware and
  35. * application requirements.
  36. *
  37. * These parameters and more are described within the 'configuration' section of the
  38. * FreeRTOS API documentation available on the FreeRTOS.org web site.
  39. *
  40. * See http://www.freertos.org/a00110.html
  41. *----------------------------------------------------------*/
  42. /* USER CODE BEGIN Includes */
  43. /* Section where include file can be added */
  44. /* USER CODE END Includes */
  45. /* Ensure definitions are only used by the compiler, and not by the assembler. */
  46. #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
  47. #include <stdint.h>
  48. extern uint32_t SystemCoreClock;
  49. /* USER CODE BEGIN 0 */
  50. extern void configureTimerForRunTimeStats(void);
  51. extern unsigned long getRunTimeCounterValue(void);
  52. /* USER CODE END 0 */
  53. #endif
  54. #define configUSE_PREEMPTION 1
  55. #define configSUPPORT_STATIC_ALLOCATION 1
  56. #define configSUPPORT_DYNAMIC_ALLOCATION 1
  57. #define configUSE_IDLE_HOOK 0
  58. #define configUSE_TICK_HOOK 0
  59. #define configCPU_CLOCK_HZ ( SystemCoreClock )
  60. #define configTICK_RATE_HZ ((TickType_t)1000)
  61. #define configMAX_PRIORITIES ( 56 )
  62. #define configMINIMAL_STACK_SIZE ((uint16_t)128)
  63. #define configTOTAL_HEAP_SIZE ((size_t)10240)
  64. #define configMAX_TASK_NAME_LEN ( 16 )
  65. #define configGENERATE_RUN_TIME_STATS 1
  66. #define configUSE_TRACE_FACILITY 1
  67. #define configUSE_STATS_FORMATTING_FUNCTIONS 1
  68. #define configUSE_16_BIT_TICKS 0
  69. #define configUSE_MUTEXES 1
  70. #define configQUEUE_REGISTRY_SIZE 8
  71. #define configUSE_RECURSIVE_MUTEXES 1
  72. #define configUSE_COUNTING_SEMAPHORES 1
  73. #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
  74. #define configUSE_TICKLESS_IDLE 1
  75. /* Co-routine definitions. */
  76. #define configUSE_CO_ROUTINES 0
  77. #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
  78. /* Software timer definitions. */
  79. #define configUSE_TIMERS 1
  80. #define configTIMER_TASK_PRIORITY ( 2 )
  81. #define configTIMER_QUEUE_LENGTH 10
  82. #define configTIMER_TASK_STACK_DEPTH 256
  83. /* Set the following definitions to 1 to include the API function, or zero
  84. to exclude the API function. */
  85. #define INCLUDE_vTaskPrioritySet 1
  86. #define INCLUDE_uxTaskPriorityGet 1
  87. #define INCLUDE_vTaskDelete 1
  88. #define INCLUDE_vTaskCleanUpResources 0
  89. #define INCLUDE_vTaskSuspend 1
  90. #define INCLUDE_vTaskDelayUntil 1
  91. #define INCLUDE_vTaskDelay 1
  92. #define INCLUDE_xTaskGetSchedulerState 1
  93. #define INCLUDE_xTimerPendFunctionCall 1
  94. #define INCLUDE_xQueueGetMutexHolder 1
  95. #define INCLUDE_xSemaphoreGetMutexHolder 1
  96. #define INCLUDE_uxTaskGetStackHighWaterMark 1
  97. #define INCLUDE_eTaskGetState 1
  98. #define INCLUDE_xTaskGetHandle 1
  99. /*
  100. * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used
  101. * by the application thus the correct define need to be enabled below
  102. */
  103. #define USE_FreeRTOS_HEAP_4
  104. /* Cortex-M specific definitions. */
  105. #ifdef __NVIC_PRIO_BITS
  106. /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
  107. #define configPRIO_BITS __NVIC_PRIO_BITS
  108. #else
  109. #define configPRIO_BITS 4
  110. #endif
  111. /* The lowest interrupt priority that can be used in a call to a "set priority"
  112. function. */
  113. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
  114. /* The highest interrupt priority that can be used by any interrupt service
  115. routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
  116. INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
  117. PRIORITY THAN THIS! (higher priorities are lower numeric values. */
  118. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
  119. /* Interrupt priorities used by the kernel port layer itself. These are generic
  120. to all Cortex-M ports, and do not rely on any particular library functions. */
  121. #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  122. /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
  123. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
  124. #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
  125. /* Normal assert() semantics without relying on the provision of an assert.h
  126. header file. */
  127. /* USER CODE BEGIN 1 */
  128. #define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
  129. /* USER CODE END 1 */
  130. /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
  131. standard names. */
  132. #define vPortSVCHandler SVC_Handler
  133. #define xPortPendSVHandler PendSV_Handler
  134. /* IMPORTANT: This define is commented when used with STM32Cube firmware, when the timebase source is SysTick,
  135. to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
  136. #define xPortSysTickHandler SysTick_Handler
  137. /* USER CODE BEGIN 2 */
  138. /* Definitions needed when configGENERATE_RUN_TIME_STATS is on */
  139. #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configureTimerForRunTimeStats
  140. #define portGET_RUN_TIME_COUNTER_VALUE getRunTimeCounterValue
  141. /* USER CODE END 2 */
  142. /* USER CODE BEGIN Defines */
  143. /* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
  144. /* USER CODE END Defines */
  145. #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
  146. void PreSleepProcessing(uint32_t *ulExpectedIdleTime);
  147. void PostSleepProcessing(uint32_t *ulExpectedIdleTime);
  148. #endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */
  149. /* The configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros
  150. allow the application writer to add additional code before and after the MCU is
  151. placed into the low power state respectively. */
  152. #if configUSE_TICKLESS_IDLE == 1
  153. #define configPRE_SLEEP_PROCESSING PreSleepProcessing
  154. #define configPOST_SLEEP_PROCESSING PostSleepProcessing
  155. #endif /* configUSE_TICKLESS_IDLE == 1 */
  156. #endif /* FREERTOS_CONFIG_H */