From 079313ee8e7d8b4fd6a04533f37ed551310869a3 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 14 Feb 2026 19:23:00 +0800 Subject: [PATCH 1/6] =?UTF-8?q?[update]=E7=BB=99=20ek=5Fdef.h=20=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86stdarg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L2_Core/utils/inc/ek_def.h | 1 + 1 file changed, 1 insertion(+) diff --git a/L2_Core/utils/inc/ek_def.h b/L2_Core/utils/inc/ek_def.h index 964e18d..2c66cf0 100644 --- a/L2_Core/utils/inc/ek_def.h +++ b/L2_Core/utils/inc/ek_def.h @@ -16,6 +16,7 @@ #define EK_DEF_H #include +#include #include #include #include From 1a4f0b30b0eb9be6212f6f0bf46f394168341664 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Sat, 14 Feb 2026 19:34:32 +0800 Subject: [PATCH 2/6] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8D=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L2_Core/utils/src/ek_log.c | 2 +- ek_conf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/L2_Core/utils/src/ek_log.c b/L2_Core/utils/src/ek_log.c index 6d89ec3..fce01f5 100644 --- a/L2_Core/utils/src/ek_log.c +++ b/L2_Core/utils/src/ek_log.c @@ -59,7 +59,7 @@ void _ek_log_printf(const char *tag, uint32_t line, ek_log_type_t type, uint32_t va_list args; va_start(args, fmt); - lwvsnprintf(ek_log_buffer, EK_LOG_BUFFER_SIZE - 1, fmt, args); + ek_vsnprintf(ek_log_buffer, EK_LOG_BUFFER_SIZE - 1, fmt, args); va_end(args); ek_printf("%s", ek_log_buffer); diff --git a/ek_conf.h b/ek_conf.h index 0ceee69..e44e1b9 100644 --- a/ek_conf.h +++ b/ek_conf.h @@ -46,7 +46,7 @@ #define EK_VEC_ENABLE (1) #define EK_RINGBUF_ENABLE (1) #define EK_STACK_ENABLE (1) -#define EK_SHELL_ENABLE (1) +#define EK_SHELL_ENABLE (0) /* ======================================================================== * 日志模块配置 From aca03280c7088f93b0b3f0bd47715bf01043afa7 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Tue, 24 Feb 2026 13:15:21 +0800 Subject: [PATCH 3/6] =?UTF-8?q?[feat]=E6=B7=BB=E5=8A=A0=E4=BA=86=20?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=8A=9F=E8=83=BD=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L2_Core/port/gd32f470zgt6/gd_gpio_port.c | 2 +- L2_Core/port/stm32f429zi/st_gpio_port.c | 2 +- L2_Core/utils/inc/ek_def.h | 12 ++++++++++++ L2_Core/utils/src/ek_assert.c | 7 +------ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/L2_Core/port/gd32f470zgt6/gd_gpio_port.c b/L2_Core/port/gd32f470zgt6/gd_gpio_port.c index 984b486..e61fa35 100644 --- a/L2_Core/port/gd32f470zgt6/gd_gpio_port.c +++ b/L2_Core/port/gd32f470zgt6/gd_gpio_port.c @@ -59,7 +59,7 @@ static const ek_gpio_ops_t gd_gpio_ops = { // 注册到hal void gd_gpio_drv_init(void) { - for (uint8_t i = 0; i < sizeof(gd_drv_gpio_table) / sizeof(gd_drv_gpio_table[0]); i++) + for (uint8_t i = 0; i < EK_ARRAY_LEN(gd_drv_gpio_table); i++) { ek_hal_gpio_register(gd_drv_gpio_table[i].dev, gd_drv_gpio_table[i].name, diff --git a/L2_Core/port/stm32f429zi/st_gpio_port.c b/L2_Core/port/stm32f429zi/st_gpio_port.c index 52c4162..53be942 100644 --- a/L2_Core/port/stm32f429zi/st_gpio_port.c +++ b/L2_Core/port/stm32f429zi/st_gpio_port.c @@ -49,7 +49,7 @@ static const ek_gpio_ops_t st_gpio_ops = { // 注册到hal void st_gpio_drv_init(void) { - for (uint8_t i = 0; i < sizeof(st_drv_gpio_table) / sizeof(st_drv_gpio_table[0]); i++) + for (uint8_t i = 0; i < EK_ARRAY_LEN(st_drv_gpio_table); i++) { ek_hal_gpio_register(st_drv_gpio_table[i].dev, st_drv_gpio_table[i].name, diff --git a/L2_Core/utils/inc/ek_def.h b/L2_Core/utils/inc/ek_def.h index 2c66cf0..378c618 100644 --- a/L2_Core/utils/inc/ek_def.h +++ b/L2_Core/utils/inc/ek_def.h @@ -80,6 +80,11 @@ # define __ASM __asm /* ========== 不支持的编译器(空定义) ========== */ #else + +# if 1 +# error "unsupport compiler.please fixup the marcos below." +# endif + # define __WEAK # define __PACKED # define __PACKED_STRUCT struct @@ -94,4 +99,11 @@ # define __ASM asm #endif +/* ========== 功能宏 ========== */ +#define EK_ARRAY_LEN(x) (sizeof(x) / (sizeof(x[0]))) +#define EK_CLAMP(val, min, max) ((val < min) ? (min) : (val > max ? max : min)) +#define EK_GET_FILE_NAME(file_path) \ + (strrchr(file_path, '/') ? strrchr(file_path, '/') + 1 \ + : (strrchr(file_path, '\\') ? strrchr(file_path, '\\') + 1 : file_path)) + #endif /* EK_DEF_H */ diff --git a/L2_Core/utils/src/ek_assert.c b/L2_Core/utils/src/ek_assert.c index 2150a32..fef0a5e 100644 --- a/L2_Core/utils/src/ek_assert.c +++ b/L2_Core/utils/src/ek_assert.c @@ -6,17 +6,12 @@ #include "../inc/ek_assert.h" #include "../inc/ek_log.h" -#include - -#define GET_FILE_NAME(file_path) \ - (strrchr(file_path, '/') ? strrchr(file_path, '/') + 1 \ - : (strrchr(file_path, '\\') ? strrchr(file_path, '\\') + 1 : file_path)) void ek_assert_fault(const char *file, uint32_t line, const char *expr) { #if EK_ASSERT_WITH_LOG == 1 EK_LOG_FILE_TAG("ek_assert.c"); - EK_LOG_ERROR("file:%s,line:%" PRIu32 ",expr: %s", GET_FILE_NAME(file), line, expr); + EK_LOG_ERROR("file:%s,line:%" PRIu32 ",expr: %s", EK_GET_FILE_NAME(file), line, expr); #else __UNUSED(file); __UNUSED(line); From e64df4c4a7af53641e9ce0db3822acd780288b97 Mon Sep 17 00:00:00 2001 From: N1netyNine99 Date: Tue, 24 Feb 2026 13:15:52 +0800 Subject: [PATCH 4/6] =?UTF-8?q?[fix]=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- L2_Core/utils/src/ek_log.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/L2_Core/utils/src/ek_log.c b/L2_Core/utils/src/ek_log.c index fce01f5..5b9a5e8 100644 --- a/L2_Core/utils/src/ek_log.c +++ b/L2_Core/utils/src/ek_log.c @@ -46,13 +46,8 @@ void _ek_log_printf(const char *tag, uint32_t line, ek_log_type_t type, uint32_t EK_LOG_LOCK(); # if (EK_LOG_COLOR_ENABLE == 1) - - ek_printf("%s[%s/%s L:%" PRIu32 ",T:%" PRIu32 "]:", - ek_log_color_table[type], - ek_log_type_table[type], - tag, - line, - _ek_log_get_tick()); + ek_printf( + "%s[%s/%s L:%" PRIu32 ",T:%" PRIu32 "]:", ek_log_color_table[type], ek_log_type_table[type], tag, line, tick); # else /* EK_LOG_COLOR_ENABLE == 1 */ ek_printf("[%s/%s L:%" PRIu32 ",T:%" PRIu32 "]:", ek_log_type_table[type], tag, line, tick); # endif /* EK_LOG_COLOR_ENABLE == 1 */ From 0f26560ff4aa3d6762ab0eca0f78339f7a8d7e32 Mon Sep 17 00:00:00 2001 From: N1netyNine99 <112536115+00lllooolll00@users.noreply.github.com> Date: Wed, 25 Feb 2026 18:06:41 +0800 Subject: [PATCH 5/6] Update L2_Core/utils/inc/ek_def.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- L2_Core/utils/inc/ek_def.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/L2_Core/utils/inc/ek_def.h b/L2_Core/utils/inc/ek_def.h index 378c618..4573a23 100644 --- a/L2_Core/utils/inc/ek_def.h +++ b/L2_Core/utils/inc/ek_def.h @@ -100,10 +100,10 @@ #endif /* ========== 功能宏 ========== */ -#define EK_ARRAY_LEN(x) (sizeof(x) / (sizeof(x[0]))) -#define EK_CLAMP(val, min, max) ((val < min) ? (min) : (val > max ? max : min)) -#define EK_GET_FILE_NAME(file_path) \ - (strrchr(file_path, '/') ? strrchr(file_path, '/') + 1 \ - : (strrchr(file_path, '\\') ? strrchr(file_path, '\\') + 1 : file_path)) +#define EK_ARRAY_LEN(x) (sizeof(x) / (sizeof((x)[0]))) +#define EK_CLAMP(val, min, max) (((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val))) +#define EK_GET_FILE_NAME(file_path) \ + (strrchr((file_path), '/') ? strrchr((file_path), '/') + 1 \ + : (strrchr((file_path), '\\') ? strrchr((file_path), '\\') + 1 : (file_path))) #endif /* EK_DEF_H */ From 55e7474f5a3221f7c4091d4b57fca9edd60b4587 Mon Sep 17 00:00:00 2001 From: N1netyNine99 <112536115+00lllooolll00@users.noreply.github.com> Date: Wed, 25 Feb 2026 18:06:57 +0800 Subject: [PATCH 6/6] Update L2_Core/utils/inc/ek_def.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- L2_Core/utils/inc/ek_def.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/L2_Core/utils/inc/ek_def.h b/L2_Core/utils/inc/ek_def.h index 4573a23..b21bc5d 100644 --- a/L2_Core/utils/inc/ek_def.h +++ b/L2_Core/utils/inc/ek_def.h @@ -78,11 +78,11 @@ # define __STATIC_INLINE static __inline # define __ALWAYS_INLINE __forceinline # define __ASM __asm -/* ========== 不支持的编译器(空定义) ========== */ +/* ========== 不支持的编译器(需手动适配,默认编译报错) ========== */ #else # if 1 -# error "unsupport compiler.please fixup the marcos below." +# error "Unsupported compiler detected. Please review and update the macro definitions in ek_def.h for this toolchain." # endif # define __WEAK