基于LM3S9B92的uCOSII(V2.86)的移植范例

[复制链接]
3436|5
 楼主| GONGHCU 发表于 2011-9-26 20:18 | 显示全部楼层 |阅读模式
本帖最后由 永远的不知 于 2011-9-26 22:55 编辑

该移植范例是针对LM3S9B92-EVM开发板,代码稍加修改即可适合Stellaris其他系列的ARM。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
午夜粪车 发表于 2011-9-26 21:18 | 显示全部楼层
在咱们论坛贴别的链接不好吧。。。
sptt1 发表于 2011-11-3 09:07 | 显示全部楼层
呵呵,以后楼主还是自己修改后再上传吧
aass1 发表于 2011-11-3 13:21 | 显示全部楼层
晕死了
aass1 发表于 2011-11-3 13:22 | 显示全部楼层
不太妥当
李富贵 发表于 2011-11-6 15:07 | 显示全部楼层
本帖最后由 李富贵 于 2011-11-6 15:10 编辑

这个移植有问题,os_core.c里面OSIntExit ()和OSSched()两个函数中:

  1. if (OSRunning == OS_TRUE) {
  2. OS_ENTER_CRITICAL();
  3. if (OSIntNesting > 0) { /* Prevent OSIntNesting from wrapping */
  4. OSIntNesting--;
  5. }
  6. if (OSIntNesting == 0) { /* Reschedule only if all ISRs complete ... */
  7. if (OSLockNesting == 0) { /* ... and not locked. */
  8. OS_SchedNew();
  9. if (OSPrioHighRdy != OSPrioCur) { /* No Ctx Sw if current task is highest rdy */
  10. OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
  11. #if OS_TASK_PROFILE_EN > 0
  12. OSTCBHighRdy->OSTCBCtxSwCtr++; /* Inc. # of context switches to this task */
  13. #endif
  14. OSCtxSwCtr++; /* Keep track of the number of ctx switches */
  15. OSIntCtxSw(); /* Perform interrupt level ctx switch */
  16. }
  17. }
  18. }
  19. OS_EXIT_CRITICAL();
  20. }

应该改为:

  1.     OS_ENTER_CRITICAL();
  2.     if (OSIntNesting == 0u) {                          /* Schedule only if all ISRs done and ...       */
  3.         if (OSLockNesting == 0u) {                     /* ... scheduler is not locked                  */
  4.             OS_SchedNew();
  5.             OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
  6.             if (OSPrioHighRdy != OSPrioCur) {          /* No Ctx Sw if current task is highest rdy     */
  7. #if OS_TASK_PROFILE_EN > 0u
  8.                 OSTCBHighRdy->OSTCBCtxSwCtr++;         /* Inc. # of context switches to this task      */
  9. #endif
  10.                 OSCtxSwCtr++;                          /* Increment context switch counter             */
  11.                 OS_TASK_SW();                          /* Perform a context switch                     */
  12.             }
  13.         }
  14.     }
  15.     OS_EXIT_CRITICAL();

评分

参与人数 1威望 +2 收起 理由
TI_MCU + 2 感谢经验分享!!

查看全部评分

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

本版积分规则

1

主题

298

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部