没有合适的资源?快使用搜索试试~ 我知道了~
uCOS-II 常用函数参考手册.docx
0 下载量 43 浏览量
2024-05-15
13:28:44
上传
评论
收藏 20KB DOCX 举报
温馨提示
试读
10页
uCOS-II 常用函数参考手册
资源推荐
资源详情
资源评论
uCOS-II 常用函数参考手册
任务管理
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 可以分配给任务了。
2 OSTaskSuspend()
无条件挂起一个任务。调用此函数的任务也可以传递参数
OS_PRIO_SELF,挂起调用任务本身。当前任务挂起后,只有其他任务才能唤醒被
挂起的任务。任务挂起后,系统会重新进行任务调度,运行下一个优先级最高的就
绪任务。唤醒挂起任务需要调用函数 OSTaskResume()。
资源评论
imgsq
- 粉丝: 417
- 资源: 71
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功