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
|