Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

106 rader
3.9 KiB

  1. /*
  2. *********************************************************************************************************
  3. * EXAMPLE CODE
  4. *
  5. * This file is provided as an example on how to use Micrium products.
  6. *
  7. * Please feel free to use any application code labeled as 'EXAMPLE CODE' in
  8. * your application products. Example code may be used as is, in whole or in
  9. * part, or may be used as a reference only. This file can be modified as
  10. * required to meet the end-product requirements.
  11. *
  12. *********************************************************************************************************
  13. */
  14. /*
  15. *********************************************************************************************************
  16. *
  17. * APPLICATION CONFIGURATION
  18. *
  19. * EXAMPLE CODE
  20. *
  21. * Filename : app_cfg.h
  22. *********************************************************************************************************
  23. */
  24. #ifndef _APP_CFG_H_
  25. #define _APP_CFG_H_
  26. /*
  27. *********************************************************************************************************
  28. * INCLUDE FILES
  29. *********************************************************************************************************
  30. */
  31. #include <stdarg.h>
  32. #include <stdio.h>
  33. // 不受内核管理的中断等级,使用 BOUNDARY 寄存器设置任务切换时的中断屏蔽
  34. #define CPU_CFG_KA_IPL_BOUNDARY 1u
  35. // 中断优先级寄存器可用位数,ARM 官方为 8bit 由厂家裁剪
  36. #define CPU_CFG_NVIC_PRIO_BITS 4u
  37. /*
  38. *********************************************************************************************************
  39. * MODULE ENABLE / DISABLE
  40. *********************************************************************************************************
  41. */
  42. /*
  43. *********************************************************************************************************
  44. * TASK PRIORITIES
  45. *********************************************************************************************************
  46. */
  47. #define APP_CFG_STARTUP_TASK_PRIO 3u
  48. #define OS_TASK_TMR_PRIO (OS_LOWEST_PRIO - 2u)
  49. /*
  50. *********************************************************************************************************
  51. * TASK STACK SIZES
  52. * Size of the task stacks (# of OS_STK entries)
  53. *********************************************************************************************************
  54. */
  55. #define APP_CFG_STARTUP_TASK_STK_SIZE 128u
  56. /*
  57. *********************************************************************************************************
  58. * TRACE / DEBUG CONFIGURATION
  59. *********************************************************************************************************
  60. */
  61. #ifndef TRACE_LEVEL_OFF
  62. #define TRACE_LEVEL_OFF 0u
  63. #endif
  64. #ifndef TRACE_LEVEL_INFO
  65. #define TRACE_LEVEL_INFO 1u
  66. #endif
  67. #ifndef TRACE_LEVEL_DBG
  68. #define TRACE_LEVEL_DBG 2u
  69. #endif
  70. #define APP_TRACE_LEVEL TRACE_LEVEL_OFF
  71. #define APP_TRACE printf
  72. #define APP_TRACE_INFO(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_INFO) ? (void)(APP_TRACE x) : (void)0)
  73. #define APP_TRACE_DBG(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_DBG) ? (void)(APP_TRACE x) : (void)0)
  74. /*
  75. *********************************************************************************************************
  76. * MODULE END
  77. *********************************************************************************************************
  78. */
  79. #endif /* End of module include. */