中级会员
- 积分
- 498
- 金钱
- 498
- 注册时间
- 2013-11-19
- 在线时间
- 92 小时
|
发表于 2020-2-22 17:20:01
|
显示全部楼层
这个函数原型是这样
INT32U OSTaskRegGet (INT8U prio,
INT8U id,
INT8U *perr)
/*
*********************************************************************************************************
* GET THE CURRENT VALUE OF A TASK REGISTER
*
* Description: This function is called to obtain the current value of a task register. Task registers
* are application specific and can be used to store task specific values such as 'error
* numbers' (i.e. errno), statistics, etc. Each task register can hold a 32-bit value.
*
* Arguments : prio is the priority of the task you want to get the task register from. If you
* specify OS_PRIO_SELF then the task register of the current task will be obtained.
*
* id is the 'id' of the desired task register. Note that the 'id' must be less
* than OS_TASK_REG_TBL_SIZE
*
* perr is a pointer to a variable that will hold an error code related to this call.
*
* OS_ERR_NONE if the call was successful
* OS_ERR_PRIO_INVALID if you specified an invalid priority
* OS_ERR_ID_INVALID if the 'id' is not between 0 and OS_TASK_REG_TBL_SIZE-1
*
* Returns : The current value of the task's register or 0 if an error is detected.
*
* Note(s) : The maximum number of task variables is 254
*********************************************************************************************************
*/
你把id都写成0了,你应该传个变量,它返回的值如果不是0的话就对了 |
|