From 0a263cb121c4905d907fdd0bacf43747393817c5 Mon Sep 17 00:00:00 2001 From: yueling hu <502966985@qq.com> Date: Thu, 22 May 2025 10:18:56 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20rt=5Ftick=5Fget=5Fdelt?= =?UTF-8?q?a=20=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/rtthread.h | 1 + src/clock.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/rtthread.h b/include/rtthread.h index a1c0e77a038..103e26e894e 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -98,6 +98,7 @@ void rt_object_put_sethook(void (*hook)(struct rt_object *object)); * clock & timer interface */ rt_tick_t rt_tick_get(void); +rt_tick_t rt_tick_get_delta(rt_tick_t base); void rt_tick_set(rt_tick_t tick); void rt_tick_increase(void); void rt_tick_increase_tick(rt_tick_t tick); diff --git a/src/clock.c b/src/clock.c index 3481f22c61c..d2871c818d8 100644 --- a/src/clock.c +++ b/src/clock.c @@ -73,6 +73,25 @@ rt_tick_t rt_tick_get(void) } RTM_EXPORT(rt_tick_get); +/** + * @brief This function will return delta tick from base. + * + * @param base to consider + * + * @return Return delta tick. + */ +rt_tick_t rt_tick_get_delta(rt_tick_t base) +{ + rt_tick_t delta; + rt_tick_t tnow = rt_tick_get(); + if (tnow >= base) + delta = tnow - base; + else + delta = RT_TICK_MAX - base + tnow + 1; + return delta; +} +RTM_EXPORT(rt_tick_get_delta); + /** * @brief This function will set current tick. * From bb7b523d307caa2f3420d6dedfcd179690e894b7 Mon Sep 17 00:00:00 2001 From: yueling hu <502966985@qq.com> Date: Thu, 22 May 2025 19:37:36 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20rt=5Ftick=5Fget=5Fdelt?= =?UTF-8?q?a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/clock.c b/src/clock.c index d2871c818d8..794b51da7f0 100644 --- a/src/clock.c +++ b/src/clock.c @@ -82,13 +82,11 @@ RTM_EXPORT(rt_tick_get); */ rt_tick_t rt_tick_get_delta(rt_tick_t base) { - rt_tick_t delta; rt_tick_t tnow = rt_tick_get(); if (tnow >= base) - delta = tnow - base; - else - delta = RT_TICK_MAX - base + tnow + 1; - return delta; + return tnow - base; + + return RT_TICK_MAX - base + tnow + 1; } RTM_EXPORT(rt_tick_get_delta); From cfd5eba209c501ff60b4de276356f573921c1a1a Mon Sep 17 00:00:00 2001 From: yueling hu <502966985@qq.com> Date: Fri, 23 May 2025 07:17:19 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/clock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/clock.c b/src/clock.c index 794b51da7f0..4277fadc0c0 100644 --- a/src/clock.c +++ b/src/clock.c @@ -85,7 +85,6 @@ rt_tick_t rt_tick_get_delta(rt_tick_t base) rt_tick_t tnow = rt_tick_get(); if (tnow >= base) return tnow - base; - return RT_TICK_MAX - base + tnow + 1; } RTM_EXPORT(rt_tick_get_delta); From 681c02429bf485ee2b5805eed8c91acff617c748 Mon Sep 17 00:00:00 2001 From: yueling hu <502966985@qq.com> Date: Fri, 23 May 2025 17:02:54 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=8F=8C=E5=90=91=E9=93=BE=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E5=88=A4=E6=96=AD=E7=A9=BA=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/rtservice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rtservice.h b/include/rtservice.h index 3d99b461517..80247e6b7e9 100644 --- a/include/rtservice.h +++ b/include/rtservice.h @@ -100,7 +100,7 @@ rt_inline void rt_list_remove(rt_list_t *n) */ rt_inline int rt_list_isempty(const rt_list_t *l) { - return l->next == l; + return l->next == l && l->prev == l; } /** From c2893c0af7e2aac89b11cc9befec8fad98a0c272 Mon Sep 17 00:00:00 2001 From: yueling hu <502966985@qq.com> Date: Fri, 23 May 2025 19:03:07 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/rtservice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rtservice.h b/include/rtservice.h index 80247e6b7e9..3d99b461517 100644 --- a/include/rtservice.h +++ b/include/rtservice.h @@ -100,7 +100,7 @@ rt_inline void rt_list_remove(rt_list_t *n) */ rt_inline int rt_list_isempty(const rt_list_t *l) { - return l->next == l && l->prev == l; + return l->next == l; } /** From d456e3442a80f8760783b4ac16610b2e407be44a Mon Sep 17 00:00:00 2001 From: yueling hu <502966985@qq.com> Date: Fri, 23 May 2025 19:24:23 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20linux=20=20tuple=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20=EF=BC=8Cllvm-arm=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/cmake.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/cmake.py b/tools/cmake.py index e998a48e8cd..6e8b9dcfc8d 100644 --- a/tools/cmake.py +++ b/tools/cmake.py @@ -45,7 +45,7 @@ def GenerateCFiles(env, project, project_name): tool_path_conv["CMAKE_ASM_COMPILER"] = tool_path_conv_helper(rtconfig.AS) tool_path_conv["CMAKE_AR"] = tool_path_conv_helper(rtconfig.AR) tool_path_conv["CMAKE_LINKER"] = tool_path_conv_helper(rtconfig.LINK) - if rtconfig.PLATFORM in ['gcc']: + if rtconfig.PLATFORM in ['gcc','llvm-arm']: tool_path_conv["CMAKE_SIZE"] = tool_path_conv_helper(rtconfig.SIZE) tool_path_conv["CMAKE_OBJDUMP"] = tool_path_conv_helper(rtconfig.OBJDUMP) tool_path_conv["CMAKE_OBJCOPY"] = tool_path_conv_helper(rtconfig.OBJCPY) @@ -99,7 +99,7 @@ def GenerateCFiles(env, project, project_name): AS += ".exe" AR += ".exe" LINK += ".exe" - if rtconfig.PLATFORM in ['gcc']: + if rtconfig.PLATFORM in ['gcc','llvm-arm']: SIZE += ".exe" OBJDUMP += ".exe" OBJCOPY += ".exe" @@ -129,7 +129,7 @@ def GenerateCFiles(env, project, project_name): cm_file.write("SET(CMAKE_CXX_FLAGS \""+ CXXFLAGS + "\")\n") cm_file.write("SET(CMAKE_CXX_COMPILER_WORKS TRUE)\n\n") - if rtconfig.PLATFORM in ['gcc']: + if rtconfig.PLATFORM in ['gcc','llvm-arm']: cm_file.write("SET(CMAKE_OBJCOPY \""+ OBJCOPY + "\")\n") cm_file.write("SET(CMAKE_SIZE \""+ SIZE + "\")\n\n") elif rtconfig.PLATFORM in ['armcc', 'armclang']: @@ -137,7 +137,7 @@ def GenerateCFiles(env, project, project_name): LINKER_FLAGS = '' LINKER_LIBS = '' - if rtconfig.PLATFORM in ['gcc']: + if rtconfig.PLATFORM in ['gcc','llvm-arm']: LINKER_FLAGS += '-T' elif rtconfig.PLATFORM in ['armcc', 'armclang']: LINKER_FLAGS += '--scatter' @@ -186,7 +186,7 @@ def GenerateCFiles(env, project, project_name): cm_file.write("ADD_DEFINITIONS(\n") for i in env['CPPDEFINES']: - cm_file.write("\t-D" + i + "\n") + cm_file.write("\t-D" + str(i).replace("(", "").replace(")","").replace(",", " ") + "\n") cm_file.write(")\n\n") libgroups = [] @@ -290,7 +290,7 @@ def GenerateCFiles(env, project, project_name): cm_file.write("\n") cm_file.write("# Interface library search paths\n") - if rtconfig.PLATFORM in ['gcc']: + if rtconfig.PLATFORM in ['gcc','llvm-arm']: for group in libgroups: if not 'LIBPATH' in group.keys(): continue