找回密码
 注册
关于网站域名变更的通知
查看: 386|回复: 2
打印 上一主题 下一主题

uC/OS-II 常用函数参考手册

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2019-2-18 10:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

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

x
uC/OS-II 常用函数参考手册
7 r2 F3 c+ y1 O9 B. T: s- Y. e  O, S$ i# H8 m7 @1 W

任务管理

1 OSTaskCreate()

建立一个新任务。任务的建立可以在多任务环境启动之前,也可以在正在运行的任务中建立。中断处理程序中不能建立任务。一个任务可以为无限循环的结构。

函数原型:INT8U OSTaskCreate(void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio);

参数说明:task 是指向任务代码首地址的指针。

pdata 指向一个数据结构,该结构用来在建立任务时向任务传递参数。

ptos is a pointer to the task's top of stack. If the configuration constant OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high memory to low memory). 'pstk' will thus point to the highest (valid) memory location of the stack. If OS_STK_GROWTH is set to 0, 'pstk' will point to the lowest memory location of the stack and the stack will grow with increasing memory locations.

prio is the task's priority. A unique priority MUST be assigned to each task and the lower the number, the higher the priority.

返回值:

OSTaskCreate() 的返回值为下述之一:

* OS_NO_ERR:函数调用成功。

* OS_PRIO_EXIST:具有该优先级的任务已经存在。

* OS_PRIO_INVALID:参数指定的优先级大于OS_LOWEST_PRIO。

* OS_NO_MORE_TCB:系统中没有OS_TCB可以分配给任务了。

游客,如果您要查看本帖隐藏内容请回复

9 K" F9 F2 v; b& ^( C0 a

该用户从未签到

3#
发表于 2019-2-18 20:35 | 只看该作者
学习研究一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-6-11 12:39 , Processed in 0.078125 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

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