Skip to content

Commit 1e27dd8

Browse files
committed
Merge branch 'develop' into CMSIS-Pack
2 parents 36b5744 + 9b64af1 commit 1e27dd8

7 files changed

Lines changed: 991 additions & 522 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ref/
55
unused/
66

77
.vscode/
8+
.claude/
89

910
# 开发阶段屏蔽掉所有非核心文件
1011
test/

core/fc_helper.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
#pragma clang diagnostic ignored "-Wmissing-braces"
142142

143143
#pragma clang diagnostic ignored "-Wconstant-logical-operand"
144-
#pragma clang diagnostic ignored "-Wshadow"
144+
#pragma clang diagnostic ignored "-Wshadow"
145145
#elif __IS_COMPILER_ARM_COMPILER_5__
146146
/*! arm compiler 5 */
147147
#pragma push
@@ -249,16 +249,16 @@
249249
FC_CONNECT3(__fc_using_, __LINE__, _ptr)++ == NULL; \
250250
(__on_leave_expr))
251251

252-
#define __fc_using3(__declare, __on_enter_expr, __on_leave_expr) \
253-
for (__declare, \
254-
*FC_CONNECT3(__fc_using_, __LINE__, _ptr) = NULL; \
252+
#define __fc_using3(__declare, __on_enter_expr, __on_leave_expr) \
253+
for (__declare, \
254+
*FC_CONNECT3(__fc_using_, __LINE__, _ptr) = NULL; \
255255
(FC_CONNECT3(__fc_using_, __LINE__, _ptr)++ == NULL ? ((void)(__on_enter_expr), 1) : 0); \
256256
(__on_leave_expr))
257257

258-
#define __fc_using4(__dcl1, __dcl2, __on_enter_expr, __on_leave_expr) \
259-
for (__dcl1, __dcl2, \
260-
*FC_CONNECT3(__fc_using_, __LINE__, _ptr) = NULL; \
261-
(FC_CONNECT3(__fc_using_, __LINE__, _ptr)++ == NULL ? ((void)(__on_enter_expr), 1) : 0); \
258+
#define __fc_using4(__dcl1, __dcl2, __on_enter_expr, __on_leave_expr) \
259+
for (__dcl1, __dcl2, \
260+
*FC_CONNECT3(__fc_using_, __LINE__, _ptr) = NULL; \
261+
(FC_CONNECT3(__fc_using_, __LINE__, _ptr)++ == NULL ? ((void)(__on_enter_expr), 1) : 0); \
262262
(__on_leave_expr))
263263

264264
#define fc_using(...) \

core/fc_log.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,11 @@ fc_weak size_t fc_log_write_lose_hook(fc_log_t *log, int len)
448448
if (log == &default_log)
449449
{
450450
static size_t default_lose_count = 0;
451-
FC_ATOMIC_SCOPE
452451
{
453-
default_lose_count += len;
452+
FC_ATOMIC_SCOPE
453+
{
454+
default_lose_count += len;
455+
}
454456
}
455457
lose_count = default_lose_count;
456458
}
@@ -547,9 +549,15 @@ fc_weak size_t log_write_default(fc_log_file_user_t *file_user)
547549
}
548550

549551
// 标记最后一块已使用大小
550-
fc_pool_mark_used((void *)(file_user->mem.buff), file_user->total_write - file_user->block_write);
552+
if (file_user->mem.buff)
553+
{
554+
fc_pool_mark_used((void *)(file_user->mem.buff), file_user->total_write - file_user->block_write);
555+
}
551556

552-
fc_pool_fifo_push(&fc_log_pool, (void *)file_user->mem_chain); // 压入fifo
557+
if (file_user->mem_chain)
558+
{
559+
fc_pool_fifo_push(&fc_log_pool, (void *)file_user->mem_chain); // 压入fifo
560+
}
553561

554562
return file_user->total_write;
555563
}

0 commit comments

Comments
 (0)