找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2495|回复: 2
打印 上一主题 下一主题
收起左侧

STM32F1-UCOSIII-master github上下载的项目

[复制链接]
跳转到指定楼层
楼主
ID:396960 发表于 2018-9-13 09:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
stm32F1   uC/OS-III的
    作为参考或学习,可以看看
本人也想发帖赚点币,嘻嘻

单片机源程序如下:
  1. /*
  2. ************************************************************************************************************************
  3. *                                                     uC/OS-III
  4. *                                                The Real-Time Kernel
  5. *
  6. *                                  (c) Copyright 2009-2010; Micrium, Inc.; Weston, FL
  7. *                          All rights reserved.  Protected by international copyright laws.
  8. *
  9. *                                                  APPLICATION HOOKS
  10. *
  11. * File    : OS_APP_HOOKS.C
  12. * By      : JJL
  13. * Version : V3.01.2
  14. *
  15. * LICENSING TERMS:
  16. * ---------------
  17. *               uC/OS-III is provided in source form to registered licensees ONLY.  It is
  18. *               illegal to distribute this source code to any third party unless you receive
  19. *               written permission by an authorized Micrium representative.  Knowledge of
  20. *               the source code may NOT be used to develop a similar product.
  21. *
  22. *               Please help us continue to provide the Embedded community with the finest
  23. *               software available.  Your honesty is greatly appreciated.
  24. *
  25. ************************************************************************************************************************
  26. */

  27. #include <os.h>
  28. #include <os_app_hooks.h>

  29. /*$PAGE*/
  30. /*
  31. ************************************************************************************************************************
  32. *                                              SET ALL APPLICATION HOOKS
  33. *
  34. * Description: Set ALL application hooks.
  35. *
  36. * Arguments  : none.
  37. *
  38. * Note(s)    : none
  39. ************************************************************************************************************************
  40. */

  41. void  App_OS_SetAllHooks (void)
  42. {
  43. #if OS_CFG_APP_HOOKS_EN > 0u
  44.     CPU_SR_ALLOC();


  45.     CPU_CRITICAL_ENTER();
  46.     OS_AppTaskCreateHookPtr = App_OS_TaskCreateHook;
  47.     OS_AppTaskDelHookPtr    = App_OS_TaskDelHook;
  48.     OS_AppTaskReturnHookPtr = App_OS_TaskReturnHook;

  49.     OS_AppIdleTaskHookPtr   = App_OS_IdleTaskHook;
  50.     OS_AppStatTaskHookPtr   = App_OS_StatTaskHook;
  51.     OS_AppTaskSwHookPtr     = App_OS_TaskSwHook;
  52.     OS_AppTimeTickHookPtr   = App_OS_TimeTickHook;
  53.     CPU_CRITICAL_EXIT();
  54. #endif
  55. }

  56. /*$PAGE*/
  57. /*
  58. ************************************************************************************************************************
  59. *                                             CLEAR ALL APPLICATION HOOKS
  60. *
  61. * Description: Clear ALL application hooks.
  62. *
  63. * Arguments  : none.
  64. *
  65. * Note(s)    : none
  66. ************************************************************************************************************************
  67. */

  68. void  App_OS_ClrAllHooks (void)
  69. {
  70. #if OS_CFG_APP_HOOKS_EN > 0u
  71.     CPU_SR_ALLOC();


  72.     CPU_CRITICAL_ENTER();
  73.     OS_AppTaskCreateHookPtr = (OS_APP_HOOK_TCB)0;
  74.     OS_AppTaskDelHookPtr    = (OS_APP_HOOK_TCB)0;
  75.     OS_AppTaskReturnHookPtr = (OS_APP_HOOK_TCB)0;

  76.     OS_AppIdleTaskHookPtr   = (OS_APP_HOOK_VOID)0;
  77.     OS_AppStatTaskHookPtr   = (OS_APP_HOOK_VOID)0;
  78.     OS_AppTaskSwHookPtr     = (OS_APP_HOOK_VOID)0;
  79.     OS_AppTimeTickHookPtr   = (OS_APP_HOOK_VOID)0;
  80.     CPU_CRITICAL_EXIT();
  81. #endif
  82. }

  83. /*$PAGE*/
  84. /*
  85. ************************************************************************************************************************
  86. *                                            APPLICATION TASK CREATION HOOK
  87. *
  88. * Description: This function is called when a task is created.
  89. *
  90. * Arguments  : p_tcb   is a pointer to the task control block of the task being created.
  91. *
  92. * Note(s)    : none
  93. ************************************************************************************************************************
  94. */

  95. void  App_OS_TaskCreateHook (OS_TCB  *p_tcb)
  96. {
  97.     (void)&p_tcb;
  98. }

  99. /*$PAGE*/
  100. /*
  101. ************************************************************************************************************************
  102. *                                            APPLICATION TASK DELETION HOOK
  103. *
  104. * Description: This function is called when a task is deleted.
  105. *
  106. * Arguments  : p_tcb   is a pointer to the task control block of the task being deleted.
  107. *
  108. * Note(s)    : none
  109. ************************************************************************************************************************
  110. */

  111. void  App_OS_TaskDelHook (OS_TCB  *p_tcb)
  112. {
  113.     (void)&p_tcb;
  114. }

  115. /*$PAGE*/
  116. /*
  117. ************************************************************************************************************************
  118. *                                             APPLICATION TASK RETURN HOOK
  119. *
  120. * Description: This function is called if a task accidentally returns.  In other words, a task should either be an
  121. *              infinite loop or delete itself when done.
  122. *
  123. * Arguments  : p_tcb     is a pointer to the OS_TCB of the task that is returning.
  124. *
  125. * Note(s)    : none
  126. ************************************************************************************************************************
  127. */

  128. void  App_OS_TaskReturnHook (OS_TCB  *p_tcb)
  129. {
  130.     (void)&p_tcb;
  131. }

  132. /*$PAGE*/
  133. /*
  134. ************************************************************************************************************************
  135. *                                              APPLICATION IDLE TASK HOOK
  136. *
  137. * Description: This function is called by the idle task.  This hook has been added to allow you to do such things as
  138. *              STOP the CPU to conserve power.
  139. *
  140. * Arguments  : none
  141. *
  142. * Note(s)    : none
  143. ************************************************************************************************************************
  144. */

  145. void  App_OS_IdleTaskHook (void)
  146. {

  147. }

  148. /*$PAGE*/
  149. /*
  150. ************************************************************************************************************************
  151. *                                          APPLICATION OS INITIALIZATION HOOK
  152. *
  153. * Description: This function is called by OSInit() at the beginning of OSInit().
  154. *
  155. * Arguments  : none
  156. *
  157. * Note(s)    : none
  158. ************************************************************************************************************************
  159. */

  160. void  App_OS_InitHook (void)
  161. {

  162. }

  163. /*$PAGE*/
  164. /*
  165. ************************************************************************************************************************
  166. *                                           APPLICATION STATISTIC TASK HOOK
  167. *
  168. * Description: This function is called every second by uC/OS-III's statistics task.  This allows your application to add
  169. *              functionality to the statistics task.
  170. *
  171. * Arguments  : none
  172. *
  173. * Note(s)    : none
  174. ************************************************************************************************************************
  175. */

  176. void  App_OS_StatTaskHook (void)
  177. {

  178. }

  179. /*$PAGE*/
  180. /*
  181. ************************************************************************************************************************
  182. *                                             APPLICATION TASK SWITCH HOOK
  183. *
  184. * Description: This function is called when a task switch is performed.  This allows you to perform other operations
  185. *              during a context switch.
  186. *
  187. * Arguments  : none
  188. *
  189. * Note(s)    : 1) Interrupts are disabled during this call.
  190. *              2) It is assumed that the global pointer 'OSTCBHighRdyPtr' points to the TCB of the task that will be
  191. *                 'switched in' (i.e. the highest priority task) and, 'OSTCBCurPtr' points to the task being switched out
  192. *                 (i.e. the preempted task).
  193. ************************************************************************************************************************
  194. */

  195. void  App_OS_TaskSwHook (void)
  196. {

  197. }

  198. /*$PAGE*/
  199. /*
  200. ************************************************************************************************************************
  201. *                                                APPLICATION TICK HOOK
  202. *
  203. * Description: This function is called every tick.
  204. *
  205. * Arguments  : none
  206. *
  207. * Note(s)    : 1) This function is assumed to be called from the Tick ISR.
  208. ************************************************************************************************************************
  209. */

  210. void  App_OS_TimeTickHook (void)
  211. {

  212. }

复制代码

所有资料51hei提供下载:
STM32F1-UCOSIII-master.zip (658.51 KB, 下载次数: 22)


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:292427 发表于 2019-9-6 23:24 | 只看该作者
这是stm32F103的吗
回复

使用道具 举报

板凳
ID:292427 发表于 2019-9-6 23:24 | 只看该作者
这是stm32F103的吗
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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