FreeRTOSConfig.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * FreeRTOS Kernel V10.4.4
  3. * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * SPDX-License-Identifier: MIT
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  8. * this software and associated documentation files (the "Software"), to deal in
  9. * the Software without restriction, including without limitation the rights to
  10. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  11. * the Software, and to permit persons to whom the Software is furnished to do so,
  12. * subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included in all
  15. * copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  19. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  20. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  21. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. * https://www.FreeRTOS.org
  25. * https://github.com/FreeRTOS
  26. *
  27. */
  28. #ifndef FREERTOS_CONFIG_H
  29. #define FREERTOS_CONFIG_H
  30. //#define SEGGER_SYSTEMVIEW //选择SYSTEM查看
  31. //#define SEGGER_RTT_PRINTF //选择RTT打印
  32. #ifdef SEGGER_SYSTEMVIEW
  33. #include "SEGGER_SYSVIEW_FreeRTOS.h"
  34. #endif
  35. /*-----------------------------------------------------------
  36. * Application specific definitions.
  37. *
  38. * These definitions should be adjusted for your particular hardware and
  39. * application requirements.
  40. *
  41. * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
  42. * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
  43. *
  44. * See http://www.freertos.org/a00110.html.
  45. *----------------------------------------------------------*/
  46. #define configCPU_CLOCK_HZ ( 48000000UL )
  47. #define configTICK_RATE_HZ ((TickType_t) 1000 )
  48. #define configMAX_PRIORITIES 15
  49. #define configMINIMAL_STACK_SIZE ((unsigned short) 90 )
  50. #define configMAX_TASK_NAME_LEN 10
  51. #define configUSE_16_BIT_TICKS 0
  52. #define configIDLE_SHOULD_YIELD 1
  53. #define configUSE_PREEMPTION 1
  54. #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
  55. #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
  56. #define configUSE_TASK_NOTIFICATIONS 1
  57. #define configUSE_TIME_SLICING 1
  58. #define configUSE_NEWLIB_REENTRANT 0
  59. #define configENABLE_BACKWARD_COMPATIBILITY 1
  60. #define configUSE_POSIX_ERRNO 0
  61. #define configUSE_APPLICATION_TASK_TAG 0
  62. #define configRECORD_STACK_HIGH_ADDRESS 0
  63. /* Definition assert() function. */
  64. #define configASSERT(x) if((x)==0) { taskDISABLE_INTERRUPTS(); for( ;; ); }
  65. /* The highest interrupt priority that can be used by any interrupt service
  66. routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
  67. INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
  68. PRIORITY THAN THIS! (higher priorities are lower numeric values. */
  69. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ( 1 )
  70. /* Memory allocation related definitions. */
  71. #define configSUPPORT_STATIC_ALLOCATION 0
  72. #define configSUPPORT_DYNAMIC_ALLOCATION 1
  73. #define configTOTAL_HEAP_SIZE (( size_t ) 8192*8 )
  74. #define configAPPLICATION_ALLOCATED_HEAP 0
  75. /* Hook function related definitions. */
  76. #define configUSE_IDLE_HOOK 0
  77. #define configUSE_TICK_HOOK 0
  78. #define configUSE_MALLOC_FAILED_HOOK 0
  79. #define configCHECK_FOR_STACK_OVERFLOW 0
  80. #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
  81. /* Run time and task stats gathering related definitions. */
  82. #define configGENERATE_RUN_TIME_STATS 0
  83. #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
  84. #define portGET_RUN_TIME_COUNTER_VALUE() xTaskGetTickCount()
  85. #define configUSE_TRACE_FACILITY 1
  86. #define configUSE_STATS_FORMATTING_FUNCTIONS 1
  87. /* Co-routine related definitions. */
  88. #define configUSE_CO_ROUTINES 0
  89. #define configMAX_CO_ROUTINE_PRIORITIES 2
  90. /* SEMAPHORES and MUTEXS */
  91. #define configUSE_MUTEXES 1
  92. #define configUSE_RECURSIVE_MUTEXES 1
  93. #define configUSE_COUNTING_SEMAPHORES 1
  94. /* Software timer related definitions. */
  95. #define configUSE_TIMERS 1
  96. #define configTIMER_TASK_PRIORITY 14
  97. #define configTIMER_QUEUE_LENGTH 10
  98. #define configTIMER_TASK_STACK_DEPTH 256
  99. #define configIDLE_TASK_STACK_DEPTH 512
  100. /* Tickless Idle Mode */
  101. #define configUSE_TICKLESS_IDLE 1
  102. /* QUEUE */
  103. #define configQUEUE_REGISTRY_SIZE 2
  104. #define configUSE_QUEUE_SETS 0
  105. /* Optional functions - most linkers will remove unused functions anyway. */
  106. #define INCLUDE_vTaskPrioritySet 1
  107. #define INCLUDE_uxTaskPriorityGet 1
  108. #define INCLUDE_vTaskDelete 1
  109. #define INCLUDE_vTaskSuspend 1
  110. #define INCLUDE_vTaskDelayUntil 1
  111. #define INCLUDE_vTaskDelay 1
  112. #define INCLUDE_xTaskGetSchedulerState 1
  113. #define INCLUDE_xTaskGetCurrentTaskHandle 1
  114. #define INCLUDE_uxTaskGetStackHighWaterMark 1
  115. #define INCLUDE_uxTaskGetStackHighWaterMark2 0
  116. #define INCLUDE_xTaskGetIdleTaskHandle 0
  117. #define INCLUDE_eTaskGetState 1
  118. #define INCLUDE_xEventGroupSetBitFromISR 1
  119. #define INCLUDE_xTimerPendFunctionCall 1
  120. #define INCLUDE_xTaskAbortDelay 1
  121. #define INCLUDE_xTaskGetHandle 1
  122. #define INCLUDE_xTaskResumeFromISR 1
  123. #define INCLUDE_xQueueGetMutexHolder 1
  124. /* Run time stats gathering definitions. */
  125. #ifdef __GNUC__
  126. /* The #ifdef just prevents this C specific syntax from being included in
  127. assembly files. */
  128. void vMainConfigureTimerForRunTimeStats( void );
  129. unsigned long ulMainGetRunTimeCounterValue( void );
  130. #endif
  131. /* Cortex-M specific definitions. */
  132. #ifdef __NVIC_PRIO_BITS
  133. #define configPRIO_BITS __NVIC_PRIO_BITS
  134. #else
  135. #define configPRIO_BITS 4
  136. #endif
  137. /* The lowest interrupt priority that can be used in a call to a "set priority"
  138. function. */
  139. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY (0x07) //0x01->0x07
  140. /* Interrupt priorities used by the kernel port layer itself. These are generic
  141. to all Cortex-M ports, and do not rely on any particular library functions. */
  142. #ifndef configKERNEL_INTERRUPT_PRIORITY
  143. #define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8-configPRIO_BITS))
  144. #endif
  145. /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
  146. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
  147. #ifndef configMAX_SYSCALL_INTERRUPT_PRIORITY
  148. #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8-configPRIO_BITS))
  149. #endif
  150. /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
  151. standard names. */
  152. #define vPortSVCHandler SVC_Handler
  153. #define xPortPendSVHandler PendSV_Handler
  154. #define xPortSysTickHandler SysTick_Handler
  155. #endif /* FREERTOS_CONFIG_H */