os_cfg.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /***********************************Jieli tech************************************************
  2. File : os_cfg.h
  3. By : Juntham
  4. date : 2014-07-03 09:09
  5. ********************************************************************************************/
  6. #ifndef OS_CFG_H
  7. #define OS_CFG_H
  8. #include "os/os_cpu.h"
  9. #define OS_TIME_SLICE_EN 1
  10. #define OS_PRIORITY_INVERSION 1 /*是否处理优先级翻转*/
  11. /* ---------------------- MISCELLANEOUS ----------------------- */
  12. #define OS_ARG_CHK_EN 0 /* Enable (1) or Disable (0) argument checking */
  13. #define OS_CPU_HOOKS_EN 1 /* hooks are found in the processor port files */
  14. #if OS_TIME_SLICE_EN > 0
  15. #define OS_LOWEST_PRIO (0) /* Defines the lowest priority that can be assigned ... */
  16. #else
  17. #define OS_LOWEST_PRIO (0+OS_CPU_CORE-1)/* Defines the lowest priority that can be assigned */
  18. #endif
  19. #define OS_IDLE_PRIO (OS_LOWEST_PRIO) /* IDLE task priority */
  20. #define OS_MAX_TASKS 31 /* Max. number of tasks in your application, MUST be >= 2 */
  21. #define OS_SCHED_LOCK_EN 1 /* Include code for OSSchedLock() and OSSchedUnlock() */
  22. #define OS_TICKS_PER_SEC 100 /* Set the number of ticks in one second */
  23. #define OS_PARENT_TCB 1 /* 是否记录父任务的TCB */
  24. #define OS_CHILD_TCB 0 /* 是否记录子任务的TCB */
  25. /* ----------------------TASK MESSAGE QUEUES ---------------------- */
  26. #define OS_TASKQ_EN 1 /* Enable (1) or Disable (0) code generation for QUEUES */
  27. #define OS_TASKQ_ACCEPT_EN 1 /* Include code for OSTaskQAccept() */
  28. #define OS_TASKQ_PEND_EN 1 /* Include code for OSTaskQAccept() */
  29. #define OS_TASKQ_FLUSH_EN 1 /* Include code for OSTaskQFlush() */
  30. #define OS_TASKQ_POST_EN 1 /* Include code for OSTaskQPost() */
  31. #define OS_TASKQ_POST_FRONT_EN 1 /* Include code for OSTaskQPostFront() */
  32. #define OS_TASKQ_QUERY_EN 1 /* Include code for OSTaskQQuery() */
  33. /* ---------------- MUTUAL EXCLUSION SEMAPHORES --------------- */
  34. #define OS_MUTEX_EN 1 /* Enable (1) or Disable (0) code generation for MUTEX */
  35. #define OS_MUTEX_ACCEPT_EN 1 /* Include code for OSMutexAccept() */
  36. #define OS_MUTEX_DEL_EN 1 /* Include code for OSMutexDel() */
  37. #define OS_MUTEX_QUERY_EN 0 /* Include code for OSMutexQuery() */
  38. /* ------------------------ SEMAPHORES ------------------------ */
  39. #define OS_SEM_EN 1 /* Enable (1) or Disable (0) code generation for SEMAPHORES */
  40. #define OS_SEM_ACCEPT_EN 1 /* Include code for OSSemAccept() */
  41. #define OS_SEM_DEL_EN 1 /* Include code for OSSemDel() */
  42. #define OS_SEM_QUERY_EN 1 /* Include code for OSSemQuery() */
  43. #define OS_SEM_SET_EN 1 /* Include code for OSSemSet() */
  44. /* ---------------------- MESSAGE QUEUES ---------------------- */
  45. #define OS_Q_EN 1 /* Enable (1) or Disable (0) code generation for QUEUES */
  46. #define OS_Q_ACCEPT_EN 1 /* Include code for OSQAccept() */
  47. #define OS_Q_DEL_EN 1 /* Include code for OSQDel() */
  48. #define OS_Q_FLUSH_EN 1 /* Include code for OSQFlush() */
  49. #define OS_Q_POST_EN 1 /* Include code for OSQPost() */
  50. #define OS_Q_POST_FRONT_EN 1 /* Include code for OSQPostFront() */
  51. #define OS_Q_POST_OPT_EN 1 /* Include code for OSQPostOpt() */
  52. #define OS_Q_QUERY_EN 1 /* Include code for OSQQuery() */
  53. /* ----------------------- EVENT FLAGS ------------------------ */
  54. #define OS_FLAG_EN 0 /* Enable (1) or Disable (0) code generation for EVENT FLAGS */
  55. #define OS_MAX_FLAGS 1 /* Max. number of Event Flag Groups in your application */
  56. #define OS_FLAG_WAIT_CLR_EN 1 /* Include code for Wait on Clear EVENT FLAGS */
  57. #define OS_FLAG_ACCEPT_EN 1 /* Include code for OSFlagAccept() */
  58. #define OS_FLAG_DEL_EN 1 /* Include code for OSFlagDel() */
  59. #define OS_FLAG_NAME_SIZE 0//32 /* Determine the size of the name of an event flag group */
  60. #define OS_FLAG_QUERY_EN 1 /* Include code for OSFlagQuery() */
  61. #define OS_FLAGS_NBITS 32 /* Size in #bits of OS_FLAGS data type (8, 16 or 32) */
  62. /* --------------------- TASK MANAGEMENT ---------------------- */
  63. #define OS_TASK_CHANGE_PRIO_EN 1 /* Include code for OSTaskChangePrio() */
  64. #define OS_TASK_CREATE_EN 1 /* Include code for OSTaskCreate() */
  65. #define OS_TASK_DEL_EN 1 /* Include code for OSTaskDel() */
  66. #define OS_TASK_QUERY_EN 0 /* Include code for OSTaskQuery() */
  67. #define OS_TASK_SUSPEND_EN 1 /* Include code for OSTaskSuspend() and OSTaskResume() */
  68. #define OS_TASK_SW_HOOK_EN 0 /* Include code for OSTaskSwHook() */
  69. #define OS_TASK_STK_CHK 0
  70. /* --------------------- TIME MANAGEMENT ---------------------- */
  71. #define OS_TIME_DLY_HMSM_EN 0 /* Include code for OSTimeDlyHMSM() */
  72. #define OS_TIME_DLY_RESUME_EN 1 /* Include code for OSTimeDlyResume() */
  73. #define OS_TIME_GET_SET_EN 1 /* Include code for OSTimeGet() and OSTimeSet() */
  74. #define OS_TIME_TICK_HOOK_EN 0 /* Include code for OSTimeTickHook() */
  75. #define OS_EVENT_EN ((OS_Q_EN > 0) || (OS_SEM_EN > 0) || (OS_MUTEX_EN > 0))
  76. //for make
  77. #define portMAX_DELAY 0
  78. #ifndef tskIDLE_PRIORITY
  79. #define tskIDLE_PRIORITY 0
  80. #endif /* #ifndef tskIDLE_PRIORITY */
  81. #ifndef configMAX_PRIORITIES
  82. #define configMAX_PRIORITIES 8
  83. #endif /* #ifndef configMAX_PRIORITIES */
  84. #ifndef configSUPPORT_DYNAMIC_ALLOCATION
  85. /* Defaults to 1 for backward compatibility. */
  86. #define configSUPPORT_DYNAMIC_ALLOCATION 1
  87. #endif
  88. #ifndef OS_CPU_NUM
  89. #define OS_CPU_NUM CPU_CORE_NUM
  90. #endif /* #ifndef OS_CPU_NUM */
  91. #ifndef OS_MBOX_EN
  92. #define OS_MBOX_EN 0
  93. #endif
  94. #ifndef OS_MEM_EN
  95. #define OS_MEM_EN 0
  96. #endif
  97. #ifndef configAPPLICATION_ALLOCATED_HEAP
  98. #define configAPPLICATION_ALLOCATED_HEAP 0
  99. #endif
  100. #ifndef configUSE_MALLOC_FAILED_HOOK
  101. #define configUSE_MALLOC_FAILED_HOOK 0
  102. #endif
  103. #endif