硬汉嵌入式论坛

 找回密码
 立即注册
查看: 2339|回复: 1
收起左侧

[ThreadX全家桶] tx_user.h 的定义模板

[复制链接]

1

主题

11

回帖

14

积分

新手上路

积分
14
发表于 2020-10-29 10:39:58 | 显示全部楼层 |阅读模式
  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
  4. /*                                                                        */
  5. /*       This software is licensed under the Microsoft Software License   */
  6. /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
  7. /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
  8. /*       and in the root directory of this software.                      */
  9. /*                                                                        */
  10. /**************************************************************************/


  11. /**************************************************************************/
  12. /**************************************************************************/
  13. /**                                                                       */
  14. /** ThreadX Component                                                     */
  15. /**                                                                       */
  16. /**   User Specific                                                       */
  17. /**                                                                       */
  18. /**************************************************************************/
  19. /**************************************************************************/


  20. /**************************************************************************/
  21. /*                                                                        */
  22. /*  PORT SPECIFIC C INFORMATION                            RELEASE        */
  23. /*                                                                        */
  24. /*    tx_user.h                                           PORTABLE C      */
  25. /*                                                           6.0          */
  26. /*                                                                        */
  27. /*  AUTHOR                                                                */
  28. /*                                                                        */
  29. /*    William E. Lamie, Microsoft Corporation                             */
  30. /*                                                                        */
  31. /*  DESCRIPTION                                                           */
  32. /*                                                                        */
  33. /*    This file contains user defines for configuring ThreadX in specific */
  34. /*    ways. This file will have an effect only if the application and     */
  35. /*    ThreadX library are built with TX_INCLUDE_USER_DEFINE_FILE defined. */
  36. /*    Note that all the defines in this file may also be made on the      */
  37. /*    command line when building ThreadX library and application objects. */
  38. /*                                                                        */
  39. /*  RELEASE HISTORY                                                       */
  40. /*                                                                        */
  41. /*    DATE              NAME                      DESCRIPTION             */
  42. /*                                                                        */
  43. /*  05-19-2020     William E. Lamie         Initial Version 6.0           */
  44. /*                                                                        */
  45. /**************************************************************************/

  46. #ifndef TX_USER_H
  47. #define TX_USER_H

  48. #define TX_ENABLE_FPU_SUPPORT

  49. /* Define various build options for the ThreadX port.  The application should either make changes
  50.    here by commenting or un-commenting the conditional compilation defined OR supply the defines
  51.    though the compiler's equivalent of the -D option.  
  52.    
  53.    For maximum speed, the following should be defined:
  54.         TX_MAX_PRIORITIES                       32  
  55.         TX_DISABLE_PREEMPTION_THRESHOLD
  56.         TX_DISABLE_REDUNDANT_CLEARING
  57.         TX_DISABLE_NOTIFY_CALLBACKS
  58.         TX_NOT_INTERRUPTABLE
  59.         TX_TIMER_PROCESS_IN_ISR
  60.         TX_REACTIVATE_INLINE
  61.         TX_DISABLE_STACK_FILLING
  62.         TX_INLINE_THREAD_RESUME_SUSPEND
  63.    
  64.    For minimum size, the following should be defined:
  65.    
  66.         TX_MAX_PRIORITIES                       32  
  67.         TX_DISABLE_PREEMPTION_THRESHOLD
  68.         TX_DISABLE_REDUNDANT_CLEARING
  69.         TX_DISABLE_NOTIFY_CALLBACKS
  70.         TX_NOT_INTERRUPTABLE
  71.         TX_TIMER_PROCESS_IN_ISR
  72.    
  73.    Of course, many of these defines reduce functionality and/or change the behavior of the
  74.    system in ways that may not be worth the trade-off. For example, the TX_TIMER_PROCESS_IN_ISR
  75.    results in faster and smaller code, however, it increases the amount of processing in the ISR.
  76.    In addition, some services that are available in timers are not available from ISRs and will
  77.    therefore return an error if this option is used. This may or may not be desirable for a
  78.    given application.  */


  79. /* Override various options with default values already assigned in tx_port.h. Please also refer
  80.    to tx_port.h for descriptions on each of these options.  */

  81. /*
  82. #define TX_MAX_PRIORITIES                       32  
  83. #define TX_MINIMUM_STACK                        ????         
  84. #define TX_THREAD_USER_EXTENSION                ????
  85. #define TX_TIMER_THREAD_STACK_SIZE              ????
  86. #define TX_TIMER_THREAD_PRIORITY                ????
  87. */

  88. /* Determine if timer expirations (application timers, timeouts, and tx_thread_sleep calls
  89.    should be processed within the a system timer thread or directly in the timer ISR.
  90.    By default, the timer thread is used. When the following is defined, the timer expiration
  91.    processing is done directly from the timer ISR, thereby eliminating the timer thread control
  92.    block, stack, and context switching to activate it.  */

  93. /*
  94. #define TX_TIMER_PROCESS_IN_ISR
  95. */

  96. /* Determine if in-line timer reactivation should be used within the timer expiration processing.
  97.    By default, this is disabled and a function call is used. When the following is defined,
  98.    reactivating is performed in-line resulting in faster timer processing but slightly larger
  99.    code size.  */

  100. /*
  101. #define TX_REACTIVATE_INLINE
  102. */

  103. /* Determine is stack filling is enabled. By default, ThreadX stack filling is enabled,
  104.    which places an 0xEF pattern in each byte of each thread's stack.  This is used by
  105.    debuggers with ThreadX-awareness and by the ThreadX run-time stack checking feature.  */

  106. /*
  107. #define TX_DISABLE_STACK_FILLING
  108. */

  109. /* Determine whether or not stack checking is enabled. By default, ThreadX stack checking is
  110.    disabled. When the following is defined, ThreadX thread stack checking is enabled.  If stack
  111.    checking is enabled (TX_ENABLE_STACK_CHECKING is defined), the TX_DISABLE_STACK_FILLING
  112.    define is negated, thereby forcing the stack fill which is necessary for the stack checking
  113.    logic.  */


  114. #define TX_ENABLE_STACK_CHECKING


  115. /* Determine if preemption-threshold should be disabled. By default, preemption-threshold is
  116.    enabled. If the application does not use preemption-threshold, it may be disabled to reduce
  117.    code size and improve performance.  */

  118. /*
  119. #define TX_DISABLE_PREEMPTION_THRESHOLD
  120. */

  121. /* Determine if global ThreadX variables should be cleared. If the compiler startup code clears
  122.    the .bss section prior to ThreadX running, the define can be used to eliminate unnecessary
  123.    clearing of ThreadX global variables.  */

  124. /*
  125. #define TX_DISABLE_REDUNDANT_CLEARING
  126. */

  127. /* Determine if no timer processing is required. This option will help eliminate the timer
  128.    processing when not needed. The user will also have to comment out the call to
  129.    tx_timer_interrupt, which is typically made from assembly language in
  130.    tx_initialize_low_level. Note: if TX_NO_TIMER is used, the define TX_TIMER_PROCESS_IN_ISR
  131.    must also be used.  */

  132. /*
  133. #define TX_NO_TIMER
  134. #ifndef TX_TIMER_PROCESS_IN_ISR
  135. #define TX_TIMER_PROCESS_IN_ISR
  136. #endif
  137. */

  138. /* Determine if the notify callback option should be disabled. By default, notify callbacks are
  139.    enabled. If the application does not use notify callbacks, they may be disabled to reduce
  140.    code size and improve performance.  */

  141. /*
  142. #define TX_DISABLE_NOTIFY_CALLBACKS
  143. */


  144. /* Determine if the tx_thread_resume and tx_thread_suspend services should have their internal
  145.    code in-line. This results in a larger image, but improves the performance of the thread
  146.    resume and suspend services.  */

  147. /*
  148. #define TX_INLINE_THREAD_RESUME_SUSPEND
  149. */


  150. /* Determine if the internal ThreadX code is non-interruptable. This results in smaller code
  151.    size and less processing overhead, but increases the interrupt lockout time.  */

  152. /*
  153. #define TX_NOT_INTERRUPTABLE
  154. */


  155. /* Determine if the trace event logging code should be enabled. This causes slight increases in
  156.    code size and overhead, but provides the ability to generate system trace information which
  157.    is available for viewing in TraceX.  */

  158. /*
  159. #define TX_ENABLE_EVENT_TRACE
  160. */


  161. /* Determine if block pool performance gathering is required by the application. When the following is
  162.    defined, ThreadX gathers various block pool performance information. */

  163. /*
  164. #define TX_BLOCK_POOL_ENABLE_PERFORMANCE_INFO
  165. */

  166. /* Determine if byte pool performance gathering is required by the application. When the following is
  167.    defined, ThreadX gathers various byte pool performance information. */

  168. /*
  169. #define TX_BYTE_POOL_ENABLE_PERFORMANCE_INFO
  170. */

  171. /* Determine if event flags performance gathering is required by the application. When the following is
  172.    defined, ThreadX gathers various event flags performance information. */

  173. /*
  174. #define TX_EVENT_FLAGS_ENABLE_PERFORMANCE_INFO
  175. */

  176. /* Determine if mutex performance gathering is required by the application. When the following is
  177.    defined, ThreadX gathers various mutex performance information. */

  178. /*
  179. #define TX_MUTEX_ENABLE_PERFORMANCE_INFO
  180. */

  181. /* Determine if queue performance gathering is required by the application. When the following is
  182.    defined, ThreadX gathers various queue performance information. */

  183. /*
  184. #define TX_QUEUE_ENABLE_PERFORMANCE_INFO
  185. */

  186. /* Determine if semaphore performance gathering is required by the application. When the following is
  187.    defined, ThreadX gathers various semaphore performance information. */

  188. /*
  189. #define TX_SEMAPHORE_ENABLE_PERFORMANCE_INFO
  190. */

  191. /* Determine if thread performance gathering is required by the application. When the following is
  192.    defined, ThreadX gathers various thread performance information. */

  193. /*
  194. #define TX_THREAD_ENABLE_PERFORMANCE_INFO
  195. */

  196. /* Determine if timer performance gathering is required by the application. When the following is
  197.    defined, ThreadX gathers various timer performance information. */

  198. /*
  199. #define TX_TIMER_ENABLE_PERFORMANCE_INFO
  200. */

  201. #endif
复制代码


不适宜在 tx_port.h 进行修改.

取自: https://github.com/azure-rtos/ge ... b/threadx/tx_user.h
回复

使用道具 举报

1万

主题

7万

回帖

11万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
115804
QQ
发表于 2020-10-29 11:00:58 | 显示全部楼层
ThreadX各种宏定义配置参数的含义(中文注释)2020-08-12更新
http://www.armbbs.cn/forum.php?m ... 9314&fromuid=58
(出处: 硬汉嵌入式论坛)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2025-5-20 05:32 , Processed in 0.246463 second(s), 24 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

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