From ea89767f2ce50078f6dc161189c4a15720ccee7f Mon Sep 17 00:00:00 2001 From: thread-liu Date: Fri, 30 Oct 2020 10:32:44 +0800 Subject: [update] check whether it's a same console device. --- src/kservice.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/kservice.c b/src/kservice.c index 7caf43ce28..0a74f05268 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -1116,7 +1116,7 @@ RTM_EXPORT(rt_console_get_device); * * @param name the name of new console device * - * @return the old console device handler + * @return the old console device handler on successful, or RT_NULL on failure. */ rt_device_t rt_console_set_device(const char *name) { @@ -1127,6 +1127,10 @@ rt_device_t rt_console_set_device(const char *name) /* find new console device */ new_device = rt_device_find(name); + + /* check whether it's a same device */ + if (new_device == old_device) return RT_NULL; + if (new_device != RT_NULL) { if (_console_device != RT_NULL) -- cgit v1.3.1 From b9a186952cc619bc24ac55d150bca1f52be9c3e2 Mon Sep 17 00:00:00 2001 From: minghao_wang Date: Mon, 16 Nov 2020 15:10:22 +0800 Subject: fix bug of rt_memheap_detach --- src/memheap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/memheap.c b/src/memheap.c index aef56e1a74..0ff6925696 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -126,8 +126,8 @@ rt_err_t rt_memheap_detach(struct rt_memheap *heap) RT_ASSERT(heap); RT_ASSERT(rt_object_get_type(&heap->parent) == RT_Object_Class_MemHeap); RT_ASSERT(rt_object_is_systemobject(&heap->parent)); - - rt_object_detach(&(heap->lock.parent.parent)); + + rt_sem_detach(&heap->lock); rt_object_detach(&(heap->parent)); /* Return a successful completion. */ -- cgit v1.3.1 From b082c91d8be95603a3ddfc18e63bd5f3d2c5a517 Mon Sep 17 00:00:00 2001 From: yangjie11 Date: Wed, 18 Nov 2020 20:36:42 +0800 Subject: [src] add a __RTTHREAD__ global macro definition --- src/SConscript | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/SConscript b/src/SConscript index 82c3b8aaf1..c03d997cd1 100644 --- a/src/SConscript +++ b/src/SConscript @@ -29,6 +29,8 @@ if GetDepend('RT_USING_DEVICE') == False: if GetDepend('RT_USING_SMP') == False: SrcRemove(src, ['cpu.c']) -group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH) +CPPDEFINES = ['__RTTHREAD__'] + +group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) Return('group') -- cgit v1.3.1