summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/object.c b/src/object.c
index 958161e320..b09af9ddee 100644
--- a/src/object.c
+++ b/src/object.c
@@ -291,6 +291,9 @@ void rt_object_detach(rt_object_t object)
RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object));
+ /* reset object type */
+ object->type = 0;
+
/* lock interrupt */
temp = rt_hw_interrupt_disable();
@@ -378,6 +381,9 @@ void rt_object_delete(rt_object_t object)
RT_OBJECT_HOOK_CALL(rt_object_detach_hook, (object));
+ /* reset object type */
+ object->type = 0;
+
/* lock interrupt */
temp = rt_hw_interrupt_disable();
@@ -413,6 +419,22 @@ rt_bool_t rt_object_is_systemobject(rt_object_t object)
}
/**
+ * 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.
*