RT-Thread内核对象子系统其主要核心数据结构如下: 其中rt_object_class_type枚举定义内核对象类别: 而rt_object_information则抽象了对象类型,加入了一个双向链表指针数据域rt_list_node,从而将同类别的内核对象利用该双链指针链接起来,这些同类别的内核对象具有如下可能的特点: 可能在软件运行时生成,也可能在os初始化...
在对象初始化时--rt_object_init()函数,会将该对象指针(rt_list_t list)插入到information的链表中进行管理。 /*insert object into information object list*/rt_list_insert_after(&(information->object_list), &(object->list)); 在下面这段代码中information->object_list 是记录RT_Object_Class_Thread类...
调用rt_object_is_systemobject 接口可判断一个对象是否是系统对象,在 RT-Thread 操作系统中,一个系统对象也就是一个静态对象,对象类型标识上 RT_Object_Class_Static 位置位。通常使用rt_object_init() 方式初始化的对象都是系统对象。对该函数的输入参数的描述如下表: rt_object_is_systemobject() 的输入参...
1/* The global list of at device */ 2static rt_slist_t at_device_list = RT_SLIST_OBJECT_INIT(at_device_list); 3/* The global list of at device class */ 4static rt_slist_t at_device_class_list = RT_SLIST_OBJECT_INIT(at_device_class_list); at设备的具体网卡对象,例如(esp82...
struct rt_timer{struct rt_object parent; /**< inherit from rt_object */rt_list_t row[RT_TIMER_SKIP_LIST_LEVEL];void (*timeout_func)(void *parameter); /**< timeout function */void *parameter; /**< timeout function's parameter */rt_tick_t init_tick; /**< timer timeout tick ...
RT_OBJECT_HOOK_CALL(rt_timer_enter_hook, (t)); /* remove timer from timer list firstly */ _rt_timer_remove(t); if (!(t->parent.flag & RT_TIMER_FLAG_PERIODIC)) { t->parent.flag &= ~RT_TIMER_FLAG_ACTIVATED; } /*add timer to temporary list */ ...
rt_object_init((rt_object_t)timer,RT_Object_Class_Timer,name);voidrt_object_init(struct rt_object*object,enum rt_object_class_type type,const char*name){register rt_base_t temp;struct rt_list_node*node=RT_NULL;struct rt_object_information*information;/* get object information */information...
rt_uint8_ttype;/**< type of kernel object */ rt_uint8_tflag;/**< 上面的flag define */ #ifdefRT_USING_MODULE void*module_id;/**< id of application module */ #endif rt_list_tlist;/**< list node of kernel object */
4static rt_slist_t at_device_class_list = RT_SLIST_OBJECT_INIT(at_device_class_list); 1. 2. 3. 4. at设备的具体网卡对象,例如(esp8266网卡、esp32网卡等)注册到at_device_class_list 列表,对at_device_class_list 创建的网卡对象进行填充。网卡注册在驱动层进行。
/* The global list of at device */ static rt_slist_t at_device_list = RT_SLIST_OBJECT_INIT(at_device_list); /* The global list of at device class */ static rt_slist_t at_device_class_list = RT_SLIST_OBJECT_INIT(at_device_class_list); at设备的具体网卡对象,例如(esp8266网卡...