提交 7b984c2f 编写于 作者: L liang yongxiang

[kernel] add rt_object_get_type() function who return type of object without static flag

上级 c5ed4523
......@@ -62,6 +62,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type,
const char *name);
void rt_object_delete(rt_object_t object);
rt_bool_t rt_object_is_systemobject(rt_object_t object);
rt_uint8_t rt_object_get_type(rt_object_t object);
rt_object_t rt_object_find(const char *name, rt_uint8_t type);
#ifdef RT_USING_HOOK
......
......@@ -418,6 +418,22 @@ rt_bool_t rt_object_is_systemobject(rt_object_t object)
return RT_FALSE;
}
/**
* This function will return the type of object without
* RT_Object_Class_Static flag.
*
* @param object the specified object to be get type.
*
* @return the type of object.
*/
rt_uint8_t rt_object_get_type(rt_object_t object)
{
/* object check */
RT_ASSERT(object != RT_NULL);
return object->type & ~RT_Object_Class_Static;
}
/**
* This function will find specified name object from object
* container.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册