查看: 3629|回复: 3

[原创] 趁中午休息时间撸点货-FreeRTOS配置文件注释

[复制链接]
  • TA的每日心情

    2017-1-4 08:05
  • 签到天数: 11 天

    连续签到: 1 天

    [LV.3]偶尔看看II

    85

    主题

    1629

    帖子

    1

    版主

    Rank: 7Rank: 7Rank: 7

    积分
    2569

    优秀版主

    最后登录
    2019-3-28
    发表于 2016-8-5 13:17:23 | 显示全部楼层 |阅读模式
    1. /*
    2.     FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.
    3.     All rights reserved

    4.     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.

    5.     This file is part of the FreeRTOS distribution.

    6.     FreeRTOS is free software; you can redistribute it and/or modify it under
    7.     the terms of the GNU General Public License (version 2) as published by the
    8.     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.

    9.     ***************************************************************************
    10.     >>!   NOTE: The modification to the GPL is included to allow you to     !<<
    11.     >>!   distribute a combined work that includes FreeRTOS without being   !<<
    12.     >>!   obliged to provide the source code for proprietary components     !<<
    13.     >>!   outside of the FreeRTOS kernel.                                   !<<
    14.     ***************************************************************************

    15.     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
    16.     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    17.     FOR A PARTICULAR PURPOSE.  Full license text is available on the following
    18.     link: http://www.freertos.org/a00114.html

    19.     ***************************************************************************
    20.      *                                                                       *
    21.      *    FreeRTOS provides completely free yet professionally developed,    *
    22.      *    robust, strictly quality controlled, supported, and cross          *
    23.      *    platform software that is more than just the market leader, it     *
    24.      *    is the industry's de facto standard.                               *
    25.      *                                                                       *
    26.      *    Help yourself get started quickly while simultaneously helping     *
    27.      *    to support the FreeRTOS project by purchasing a FreeRTOS           *
    28.      *    tutorial book, reference manual, or both:                          *
    29.      *    http://www.FreeRTOS.org/Documentation                              *
    30.      *                                                                       *
    31.     ***************************************************************************

    32.     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
    33.     the FAQ page "My application does not run, what could be wrong?".  Have you
    34.     defined configASSERT()?

    35.     http://www.FreeRTOS.org/support - In return for receiving this top quality
    36.     embedded software for free we request you assist our global community by
    37.     participating in the support forum.

    38.     http://www.FreeRTOS.org/training - Investing in training allows your team to
    39.     be as productive as possible as early as possible.  Now you can receive
    40.     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
    41.     Ltd, and the world's leading authority on the world's leading RTOS.

    42.     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
    43.     including FreeRTOS+Trace - an indispensable productivity tool, a DOS
    44.     compatible FAT file system, and our tiny thread aware UDP/IP stack.

    45.     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
    46.     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.

    47.     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
    48.     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
    49.     licenses offer ticketed support, indemnification and commercial middleware.

    50.     http://www.SafeRTOS.com - High Integrity Systems also provide a safety
    51.     engineered and independently SIL3 certified version for use in safety and
    52.     mission critical applications that require provable dependability.

    53.     1 tab == 4 spaces!
    54. */

    55. #ifndef FREERTOS_CONFIG_H
    56. #define FREERTOS_CONFIG_H

    57. /*-----------------------------------------------------------
    58. * Application specific definitions.
    59. *
    60. * These definitions should be adjusted for your particular hardware and
    61. * application requirements.
    62. *
    63. * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
    64. * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
    65. *
    66. * See http://www.freertos.org/a00110.html.
    67. *----------------------------------------------------------*/

    68. #define configUSE_PREEMPTION 1//配置为1 使能抢占式调度器。配置为0使用合作式任务调度内核
    69. #define configUSE_IDLE_HOOK 0
    70. #define configUSE_TICK_HOOK 0
    71. #define configCPU_CLOCK_HZ (SystemCoreClock)//定义CPU主频
    72. #define configTICK_RATE_HZ ((TickType_t)1000)//系统节拍数
    73. #define configMAX_PRIORITIES (5)//最大优先级数量
    74. #define configMINIMAL_STACK_SIZE ((unsigned short)90)//堆栈大小
    75. #define configTOTAL_HEAP_SIZE ((size_t)(10 * 1024))//定义堆大小
    76. #define configMAX_TASK_NAME_LEN (10)//任务名最大长度
    77. #define configUSE_TRACE_FACILITY 1//协助可视化跟踪和调试使用IAR需要设置为1
    78. #define configUSE_16_BIT_TICKS 0//计数器为32bit试用与ARM处理器
    79. #define configIDLE_SHOULD_YIELD 1//使能与空闲任务同优先级的任务
    80. #define configUSE_MUTEXES 1//互斥信号量使能与禁止
    81. #define configQUEUE_REGISTRY_SIZE 8//注册队列和信号量的个数
    82. #define configCHECK_FOR_STACK_OVERFLOW 0//堆栈溢出检测
    83. #define configUSE_RECURSIVE_MUTEXES 1//使能与禁止递归互斥信号量
    84. #define configUSE_MALLOC_FAILED_HOOK 0//使能与禁止系统内部的动态内存申请函数
    85. #define configUSE_APPLICATION_TASK_TAG 0//使能与禁止分配任务的标签值
    86. #define configUSE_COUNTING_SEMAPHORES 1//使能与禁止计数信号量
    87. #define configGENERATE_RUN_TIME_STATS 0//使能与禁止任务运行参数状态统计
    88. #define configUSE_TIME_SLICING 1//使能与禁止时间片调度

    89. /* Co-routine definitions. */
    90. #define configUSE_CO_ROUTINES 0//使能与禁止合作式任务调度
    91. #define configMAX_CO_ROUTINE_PRIORITIES 10//最大的合作式优先级任务数

    92. /* Software timer definitions. */
    93. #define configUSE_TIMERS 1//禁止与使能软定时器
    94. #define configTIMER_TASK_PRIORITY (2)//配置定时器任务的优先级
    95. #define configTIMER_QUEUE_LENGTH 10//配置软件定时器任务队列长度
    96. #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2)//配置定时器任务堆栈大小

    97. /* Set the following definitions to 1 to include the API function, or zero
    98. to exclude the API function. */
    99. #define INCLUDE_vTaskPrioritySet 1 //设置任务优先级
    100. #define INCLUDE_uxTaskPriorityGet 1 //获取任务优先级
    101. #define INCLUDE_vTaskDelete 1 //允许删除任务
    102. #define INCLUDE_vTaskCleanUpResources 1
    103. #define INCLUDE_vTaskSuspend 1
    104. #define INCLUDE_vTaskDelayUntil 1//频率实现延时
    105. #define INCLUDE_vTaskDelay 1  //延时函数可用

    106. /* Cortex-M specific definitions. */
    107. #ifdef __NVIC_PRIO_BITS
    108. /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
    109. #define configPRIO_BITS __NVIC_PRIO_BITS
    110. #else
    111. #define configPRIO_BITS 4 /* 15 priority levels */
    112. #endif

    113. /* The lowest interrupt priority that can be used in a call to a "set priority"
    114. function. */
    115. #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf

    116. /* The highest interrupt priority that can be used by any interrupt service
    117. routine that makes calls to interrupt safe FreeRTOS API functions.  DO NOT CALL
    118. INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
    119. PRIORITY THAN THIS! (higher priorities are lower numeric values. */
    120. #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5

    121. /* Interrupt priorities used by the kernel port layer itself.  These are generic
    122. to all Cortex-M ports, and do not rely on any particular library functions. */
    123. #define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
    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. /* Normal assert() semantics without relying on the provision of an assert.h
    128. header file. */
    129. #define configASSERT(x)           \
    130.     if ((x) == 0)                 \
    131.     {                             \
    132.         taskDISABLE_INTERRUPTS(); \
    133.         for (;;)                  \
    134.             ;                     \
    135.     }

    136. /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
    137. standard names. */
    138. #define vPortSVCHandler SVC_Handler
    139. #define xPortPendSVHandler PendSV_Handler
    140. #define xPortSysTickHandler SysTick_Handler

    141. #endif /* FREERTOS_CONFIG_H */
    复制代码


    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2023-9-17 19:57
  • 签到天数: 2310 天

    连续签到: 1 天

    [LV.Master]伴坛终老

    107

    主题

    4270

    帖子

    1

    金牌会员

    Rank: 6Rank: 6

    积分
    10481
    最后登录
    2023-9-17
    发表于 2016-8-5 14:20:08 | 显示全部楼层
    不错,赞一个。
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2018-8-30 16:02
  • 签到天数: 5 天

    连续签到: 1 天

    [LV.2]偶尔看看I

    36

    主题

    1065

    帖子

    0

    金牌会员

    Rank: 6Rank: 6

    积分
    1851
    最后登录
    2019-11-19
    发表于 2016-8-5 22:53:27 | 显示全部楼层
    中午都不休息
    哎...今天够累的,签到来了~
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2018-7-23 21:04
  • 签到天数: 103 天

    连续签到: 1 天

    [LV.6]常住居民II

    228

    主题

    5379

    帖子

    0

    金牌会员

    Rank: 6Rank: 6

    积分
    16697
    最后登录
    1970-1-1
    发表于 2016-8-6 11:05:06 | 显示全部楼层
    楼主辛苦了,赞一个
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-7-18 13:58 , Processed in 0.089221 second(s), 21 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表