kirill_76rus

freeRTOS_config

Apr 4th, 2022
1,905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.20 KB | None | 0 0
  1. /*
  2.  * FreeRTOS Kernel V10.3.0
  3.  * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
  4.  *
  5.  * Permission is hereby granted, free of charge, to any person obtaining a copy of
  6.  * this software and associated documentation files (the "Software"), to deal in
  7.  * the Software without restriction, including without limitation the rights to
  8.  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  9.  * the Software, and to permit persons to whom the Software is furnished to do so,
  10.  * subject to the following conditions:
  11.  *
  12.  * The above copyright notice and this permission notice shall be included in all
  13.  * copies or substantial portions of the Software.
  14.  *
  15.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  17.  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  18.  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  19.  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20.  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21.  *
  22.  * http://www.FreeRTOS.org
  23.  * http://aws.amazon.com/freertos
  24.  *
  25.  * 1 tab == 4 spaces!
  26.  */
  27.  
  28.  
  29. #ifndef FREERTOS_CONFIG_H
  30. #define FREERTOS_CONFIG_H
  31.  
  32. /*-----------------------------------------------------------
  33.  * Application specific definitions.
  34.  *
  35.  * These definitions should be adjusted for your particular hardware and
  36.  * application requirements.
  37.  *
  38.  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
  39.  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
  40.  *
  41.  * See http://www.freertos.org/a00110.html
  42.  *----------------------------------------------------------*/
  43.  
  44. #if (defined(__ARMCC_VERSION) || defined(__GNUC__) || defined(__ICCARM__))
  45. #include <stdint.h>
  46.  
  47. extern uint32_t SystemCoreClock;
  48. #endif
  49.  
  50. /* Constants that describe the hardware and memory usage. */
  51. #define configCPU_CLOCK_HZ                    (SystemCoreClock)
  52. #define configTICK_RATE_HZ                    ((TickType_t)1000)
  53. #define configTOTAL_HEAP_SIZE                 ((size_t)4096)
  54. #define configMINIMAL_STACK_SIZE              ((uint16_t)256)
  55. #define configSUPPORT_DYNAMIC_ALLOCATION      1
  56. #define configSUPPORT_STATIC_ALLOCATION       0
  57.  
  58. /* Constants related to the behaviour or the scheduler. */
  59. #define configMAX_PRIORITIES                  5
  60. #define configUSE_PREEMPTION                  1
  61. #define configUSE_TIME_SLICING                1
  62. #define configIDLE_SHOULD_YIELD               1
  63. #define configMAX_TASK_NAME_LEN               (10)
  64. #define configUSE_16_BIT_TICKS                0
  65.  
  66. /* Software timer definitions. */
  67. #define configUSE_TIMERS                      0
  68. #define configTIMER_TASK_PRIORITY             2
  69. #define configTIMER_QUEUE_LENGTH              5
  70. #define configTIMER_TASK_STACK_DEPTH          (configMINIMAL_STACK_SIZE * 2)
  71.  
  72. /* Constants that build features in or out. */
  73. #define configUSE_MUTEXES                     1
  74. #define configUSE_RECURSIVE_MUTEXES           1
  75. #define configUSE_COUNTING_SEMAPHORES         1
  76. #define configUSE_QUEUE_SETS                  1
  77. #define configUSE_TASK_NOTIFICATIONS          1
  78. #define configUSE_TRACE_FACILITY              1
  79. #define configUSE_TICKLESS_IDLE               1
  80. #define configUSE_APPLICATION_TASK_TAG        0
  81. #define configUSE_NEWLIB_REENTRANT            0
  82. #define configUSE_CO_ROUTINES                 0
  83.  
  84. /* Constants provided for debugging and optimisation assistance. */
  85. #define configCHECK_FOR_STACK_OVERFLOW        0
  86. #define configQUEUE_REGISTRY_SIZE             0
  87. #define configASSERT( x )                     if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
  88.  
  89. /* Constants that define which hook (callback) functions should be used. */
  90. #define configUSE_IDLE_HOOK                   0
  91. #define configUSE_TICK_HOOK                   0
  92. #define configUSE_DAEMON_TASK_STARTUP_HOOK    0
  93. #define configUSE_MALLOC_FAILED_HOOK          0
  94.  
  95. /* Port specific configuration. */
  96. #define configENABLE_MPU                      0
  97. #define configENABLE_FPU                      1
  98. #define configENABLE_TRUSTZONE                1
  99. #define configMINIMAL_SECURE_STACK_SIZE       ((uint32_t)1024)
  100. #define configRUN_FREERTOS_SECURE_ONLY        0
  101.  
  102. /* Cortex-M specific definitions. */
  103. #ifdef __NVIC_PRIO_BITS
  104.   /* __NVIC_PRIO_BITS will be specified when CMSIS is being used. */
  105.   #define configPRIO_BITS                     __NVIC_PRIO_BITS
  106. #else
  107.   /* 7 priority levels */
  108.   #define configPRIO_BITS                     3
  109. #endif
  110.  
  111. /* The lowest interrupt priority that can be used in a call to a "set priority" function. */
  112. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY       0x07
  113.  
  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
  116.  * CALL INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A
  117.  * HIGHER PRIORITY THAN THIS! (higher priorities are lower numeric values). */
  118. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY  5
  119.  
  120. /* Interrupt priorities used by the kernel port layer itself.  These are generic
  121.  * to all Cortex-M ports, and do not rely on any particular library functions. */
  122. #define configKERNEL_INTERRUPT_PRIORITY               (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
  123.  
  124. /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
  125.  * See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
  126. #define configMAX_SYSCALL_INTERRUPT_PRIORITY          (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
  127.  
  128. /* Set the following definitions to 1 to include the API function, or zero
  129.  * to exclude the API function.  NOTE:  Setting an INCLUDE_ parameter to 0 is
  130.  * only necessary if the linker does not automatically remove functions that are
  131.  * not referenced anyway. */
  132. #define INCLUDE_vTaskPrioritySet              1
  133. #define INCLUDE_uxTaskPriorityGet             1
  134. #define INCLUDE_vTaskDelete                   1
  135. #define INCLUDE_vTaskSuspend                  1
  136. #define INCLUDE_xTaskDelayUntil               1
  137. #define INCLUDE_vTaskDelay                    1
  138. #define INCLUDE_xTaskGetIdleTaskHandle        1
  139. #define INCLUDE_xTaskAbortDelay               1
  140. #define INCLUDE_xQueueGetMutexHolder          1
  141. #define INCLUDE_xSemaphoreGetMutexHolder      1
  142. #define INCLUDE_xTaskGetHandle                1
  143. #define INCLUDE_uxTaskGetStackHighWaterMark   1
  144. #define INCLUDE_uxTaskGetStackHighWaterMark2  1
  145. #define INCLUDE_eTaskGetState                 1
  146. #define INCLUDE_xTaskResumeFromISR            1
  147. #define INCLUDE_xTimerPendFunctionCall        1
  148. #define INCLUDE_xTaskGetSchedulerState        1
  149. #define INCLUDE_xTaskGetCurrentTaskHandle     1
  150.  
  151. /* Map the FreeRTOS port interrupt handlers to their CMSIS standard names. */
  152. #define xPortPendSVHandler                    PendSV_Handler
  153. #define vPortSVCHandler                       SVC_Handler
  154. #define xPortSysTickHandler                   SysTick_Handler
  155.  
  156. #if (defined(__ARMCC_VERSION) || defined(__GNUC__) || defined(__ICCARM__))
  157. /* Include debug event definitions */
  158. #include "freertos_evr.h"
  159. #endif
  160.  
  161. #endif /* FREERTOS_CONFIG_H */
  162.  
Advertisement
Add Comment
Please, Sign In to add comment