Skip to content

Commit 62424c5

Browse files
committed
fix: 🐛 port组件休整,部分框架轻微改动,详见如下
1. port组件对每个fifo独立存在单次发送限制,提供快速创建宏 2. port组件取消连续触发的标志位 3. port获取fifo以占用空间API改动避免歧义 4. port与fifo的序列API调整位置与文件名 5. trans组件取消初始化时默认填充,如果要使用请尝试手动切换为非零页再切换零页即可
1 parent 5086dd8 commit 62424c5

File tree

7 files changed

+119
-125
lines changed

7 files changed

+119
-125
lines changed

core/fc_config_template.h

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,35 +73,25 @@
7373
// <i> Default: 8
7474
#define PORT_RB_NUM 8
7575

76-
// <o> FIFO_TX_LOG2_SIZE - TX FIFO Size (log2) <8-16>
76+
// <o> STDOUT_RB0_LOG2_SIZE - TX FIFO Size (log2) <8-16>
7777
// <i> Output ring buffer size as power of 2 (e.g., 12 = 4096 bytes)
7878
// <i> Default: 12 (4KB)
79-
#define FIFO_TX_LOG2_SIZE 12
79+
#define STDOUT_RB0_LOG2_SIZE 12
8080

81-
// <o> STDOUT_TX_SINGLE_MAX_SHIFT - TX Single Max Shift <1-4>
81+
// <o> STDOUT_RB0_TX_SINGLE_MAX_SHIFT - TX Single Max Shift <1-4>
8282
// <i> Single TX max bytes = buffer_size / (2^n), smaller value allows more data per transfer
8383
// <i> Default: 2
84-
#define STDOUT_TX_SINGLE_MAX_SHIFT 2
84+
#define STDOUT_RB0_TX_SINGLE_MAX_SHIFT 2
8585

86-
// <q> PHY_SERIAL_TX_ENABLE - Enable Serial TX
87-
// <i> Enable continuous serial transmission
88-
// <i> Default: 0 (Disabled)
89-
#define PHY_SERIAL_TX_ENABLE 0
90-
91-
// <o> FIFO_RX_LOG2_SIZE - RX FIFO Size (log2) <6-12>
86+
// <o> STDIN_RB0_LOG2_SIZE - RX FIFO Size (log2) <6-12>
9287
// <i> Input ring buffer size as power of 2 (e.g., 8 = 256 bytes)
9388
// <i> Default: 8 (256B)
94-
#define FIFO_RX_LOG2_SIZE 8
89+
#define STDIN_RB0_LOG2_SIZE 8
9590

96-
// <o> STDIN_RX_SINGLE_MAX_SHIFT - RX Single Max Shift <1-4>
91+
// <o> STDIN_RB0_RX_SINGLE_MAX_SHIFT - RX Single Max Shift <1-4>
9792
// <i> Single RX max bytes = buffer_size / (2^n), smaller value allows more data per transfer
9893
// <i> Default: 1
99-
#define STDIN_RX_SINGLE_MAX_SHIFT 1
100-
101-
// <q> PHY_SERIAL_RX_ENABLE - Enable Serial RX
102-
// <i> Enable continuous serial reception
103-
// <i> Default: 0 (Disabled)
104-
#define PHY_SERIAL_RX_ENABLE 0
94+
#define STDIN_RB0_RX_SINGLE_MAX_SHIFT 1
10595

10696
// </h>
10797

core/fc_port.c

Lines changed: 71 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,26 @@
3636
#define fc_assert(x) ((void)(0))
3737
#endif
3838

39-
#ifndef FIFO_TX_LOG2_SIZE
39+
#ifndef STDOUT_RB0_LOG2_SIZE
4040
/* 输出环形队列大小,2^n */
4141
// 4K Byte
42-
#define FIFO_TX_LOG2_SIZE 12
42+
#define STDOUT_RB0_LOG2_SIZE 12
4343
#endif
4444

45-
#ifndef STDOUT_TX_SINGLE_MAX_SHIFT
45+
#ifndef STDOUT_RB0_TX_SINGLE_MAX_SHIFT
4646
// 单次发送最大字节数为缓冲区的1/(2^n),多段发送可以尽快空出部分缓冲区
47-
#define STDOUT_TX_SINGLE_MAX_SHIFT 2
47+
#define STDOUT_RB0_TX_SINGLE_MAX_SHIFT 2
4848
#endif
4949

50-
// 连续发送
51-
#ifndef PHY_SERIAL_TX_ENABLE
52-
#define PHY_SERIAL_TX_ENABLE 0
53-
#endif
54-
55-
#ifndef FIFO_RX_LOG2_SIZE
50+
#ifndef STDIN_RB0_LOG2_SIZE
5651
/* 输入环形队列大小,2^n */
5752
// 256 Byte
58-
#define FIFO_RX_LOG2_SIZE 8
53+
#define STDIN_RB0_LOG2_SIZE 8
5954
#endif
6055

61-
#ifndef STDIN_RX_SINGLE_MAX_SHIFT
56+
#ifndef STDIN_RB0_RX_SINGLE_MAX_SHIFT
6257
// 单次接收最大字节数为缓冲区的1/(2^n),多段接收可以防止连续接收满了之后来不及处理
63-
#define STDIN_RX_SINGLE_MAX_SHIFT 1
64-
#endif
65-
66-
// 连续接收
67-
#ifndef PHY_SERIAL_RX_ENABLE
68-
#define PHY_SERIAL_RX_ENABLE 0
58+
#define STDIN_RB0_RX_SINGLE_MAX_SHIFT 1
6959
#endif
7060

7161
//+********************************* 提供的默认数据丢失处理钩子函数 **********************************/
@@ -111,6 +101,39 @@ fc_weak size_t fc_port_lose_hook(fc_port_t *port, size_t rb_index, const void *b
111101
}
112102

113103
//+********************************* 面向对象 **********************************/
104+
/**
105+
* @brief 初始化port,其实就是设置方向
106+
*
107+
* @param port
108+
* @param dir
109+
*/
110+
void fc_port_init(fc_port_t *port, fc_port_dir_t dir)
111+
{
112+
fc_assert(port != NULL);
113+
memset(port, 0, sizeof(fc_port_t));
114+
port->dir = (uint8_t)dir;
115+
}
116+
117+
/**
118+
* @brief port绑定环形缓冲区
119+
*
120+
* @param port
121+
* @param rb_index 环形缓冲区索引
122+
* @param fifo 环形缓冲区指针
123+
* @param name 缓冲区名字
124+
* @param single_limit 单次读写限制(针对慢速IO而言),限制大小为缓冲区空间的1/(2^n),n=single_limit
125+
*/
126+
void fc_port_catch_fifo(fc_port_t *port, size_t rb_index, fc_fifo_t *fifo, const char *name, uint8_t single_limit)
127+
{
128+
fc_assert(port != NULL);
129+
fc_assert(rb_index < PORT_RB_NUM);
130+
fc_assert(fifo != NULL);
131+
132+
port->rb[rb_index] = fifo;
133+
port->rb_name[rb_index] = name;
134+
port->rb_single_limit[rb_index] = single_limit;
135+
}
136+
114137
/**
115138
* @brief
116139
*
@@ -236,6 +259,19 @@ int fc_port_printf(fc_port_t *port, size_t rb_index, const char *fmt, ...)
236259
return ret;
237260
}
238261

262+
/**
263+
* @brief fc_port_vprintf的核心实现,将格式化字符串写入到fc_port_t的环形缓冲区中
264+
*
265+
* @param port
266+
* @param fmt
267+
* @param arp
268+
* @return int
269+
*/
270+
int fc_port_vprintf(fc_port_t *port, size_t rb_index, const char *fmt, va_list arp)
271+
{
272+
return fc_fifo_vprintf(port->rb[rb_index], fmt, arp);
273+
}
274+
239275
/**
240276
* @brief
241277
*
@@ -371,10 +407,10 @@ void fc_port_trigger(fc_port_t *port, size_t rb_index)
371407

372408
if (!busy)
373409
{
374-
if (port->single_max_shift)
410+
if (port->rb_single_limit[rb_index])
375411
{
376-
fc_assert(fc_fifo_get_size(fifo) > (1 << port->single_max_shift));
377-
buf = fc_fifo_linear_read_setup_limit(fifo, &size, port->single_max_shift);
412+
fc_assert(fc_fifo_get_size(fifo) > (1 << port->rb_single_limit[rb_index]));
413+
buf = fc_fifo_linear_read_setup_limit(fifo, &size, port->rb_single_limit[rb_index]);
378414
}
379415
else
380416
{
@@ -388,10 +424,10 @@ void fc_port_trigger(fc_port_t *port, size_t rb_index)
388424

389425
if (!busy)
390426
{
391-
if (port->single_max_shift)
427+
if (port->rb_single_limit[rb_index])
392428
{
393-
fc_assert(fc_fifo_get_size(fifo) > (1 << port->single_max_shift));
394-
buf = fc_fifo_linear_write_setup_limit(fifo, &size, port->single_max_shift);
429+
fc_assert(fc_fifo_get_size(fifo) > (1 << port->rb_single_limit[rb_index]));
430+
buf = fc_fifo_linear_write_setup_limit(fifo, &size, port->rb_single_limit[rb_index]);
395431
}
396432
else
397433
{
@@ -445,11 +481,6 @@ void fc_port_end(fc_port_t *port, size_t rb_index, int size)
445481
fc_fifo_linear_write_done(fifo, size);
446482
}
447483
}
448-
449-
if (port->trigger_serial)
450-
{
451-
return fc_port_trigger(port, rb_index);
452-
}
453484
}
454485

455486
/**
@@ -459,7 +490,7 @@ void fc_port_end(fc_port_t *port, size_t rb_index, int size)
459490
* @param rb_index
460491
* @return int
461492
*/
462-
int fc_port_available(fc_port_t *port, size_t rb_index)
493+
int fc_port_used(fc_port_t *port, size_t rb_index)
463494
{
464495
fc_assert(port != NULL);
465496
fc_assert(port->rb != NULL);
@@ -529,34 +560,28 @@ void fc_default_port_init(void)
529560
}
530561
init = true;
531562

532-
#if !(STDOUT_TX_SINGLE_MAX_SHIFT < FIFO_TX_LOG2_SIZE && STDOUT_TX_SINGLE_MAX_SHIFT >= 0 && FIFO_TX_LOG2_SIZE >= 0)
533-
#error "STDOUT_TX_SINGLE_MAX_SHIFT must less than FIFO_TX_LOG2_SIZE,please check it"
534-
#error "单次发送位移必须小于缓冲区的log2大小,且两者必须同时大于等于0"
563+
#if !(STDOUT_RB0_TX_SINGLE_MAX_SHIFT < STDOUT_RB0_LOG2_SIZE && STDOUT_RB0_TX_SINGLE_MAX_SHIFT >= 0 && STDOUT_RB0_LOG2_SIZE > 0)
564+
#error "STDOUT_RB0_TX_SINGLE_MAX_SHIFT must less than STDOUT_RB0_LOG2_SIZE,please check it"
565+
#error "单次发送位移必须小于等于缓冲区的log2大小,请检查配置"
535566
#endif
536567

537-
#if !(STDIN_RX_SINGLE_MAX_SHIFT < FIFO_RX_LOG2_SIZE && STDIN_RX_SINGLE_MAX_SHIFT >= 0 && FIFO_RX_LOG2_SIZE >= 0)
538-
#error "STDIN_RX_SINGLE_MAX_SHIFT must less than FIFO_RX_LOG2_SIZE,please check it"
539-
#error "单次接收位移必须小于缓冲区的log2大小,且两者必须同时大于等于0"
568+
#if !(STDIN_RB0_RX_SINGLE_MAX_SHIFT < STDIN_RB0_LOG2_SIZE && STDIN_RB0_RX_SINGLE_MAX_SHIFT >= 0 && STDIN_RB0_LOG2_SIZE > 0)
569+
#error "STDIN_RB0_RX_SINGLE_MAX_SHIFT must less than STDIN_RB0_LOG2_SIZE,please check it"
570+
#error "单次接收位移必须小于等于缓冲区的log2大小,请检查配置"
540571
#endif
541572

542573
{
543-
fc_stdout.single_max_shift = STDOUT_TX_SINGLE_MAX_SHIFT;
544-
fc_stdout.dir = (uint8_t)FC_PORT_DIR_OUT;
545-
fc_stdout.trigger_serial = PHY_SERIAL_TX_ENABLE ? 1 : 0;
574+
fc_port_init(&fc_stdout, FC_PORT_DIR_OUT);
546575

547576
// 初始化环形队列,静态内存构造,默认端口只给一个环形缓冲区分配内存
548-
// fc_fifo_static_new_at(fc_stdout.rb[0], FIFO_TX_LOG2_SIZE);
549-
fc_port_static_alloc_rb(&fc_stdout, 0, FIFO_TX_LOG2_SIZE, "fc_stdout_rb0");
577+
fc_port_static_alloc_rb(&fc_stdout, 0, STDOUT_RB0_LOG2_SIZE, "fc_stdout_rb0", STDOUT_RB0_TX_SINGLE_MAX_SHIFT);
550578
}
551579

552580
{
553-
fc_stdin.single_max_shift = STDIN_RX_SINGLE_MAX_SHIFT;
554-
fc_stdin.dir = (uint8_t)FC_PORT_DIR_IN;
555-
fc_stdin.trigger_serial = PHY_SERIAL_RX_ENABLE ? 1 : 0;
581+
fc_port_init(&fc_stdin, FC_PORT_DIR_IN);
556582

557583
// 初始化环形队列,静态内存构造,默认端口只给一个环形缓冲区分配内存
558-
// fc_fifo_static_new_at(fc_stdin.rb[0], FIFO_RX_LOG2_SIZE);
559-
fc_port_static_alloc_rb(&fc_stdin, 0, FIFO_RX_LOG2_SIZE, "fc_stdin_rb0");
584+
fc_port_static_alloc_rb(&fc_stdin, 0, STDIN_RB0_LOG2_SIZE, "fc_stdin_rb0", STDIN_RB0_RX_SINGLE_MAX_SHIFT);
560585
}
561586

562587
{

core/fc_port.h

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,18 @@ extern "C"
4848
FC_PORT_DIR_READ = FC_PORT_DIR_OUT, // 从缓冲区读数据
4949
} fc_port_dir_t;
5050

51-
typedef size_t (*fc_phy_io_t)(size_t rb_index, void *buf, size_t len); // 返回值仅做保留
51+
typedef size_t (*fc_phy_io_t)(size_t rb_index, void *buf, size_t len); // 返回值仅做保留,回调时保证从buf地址开始len长度一定是连续内存
5252

5353
typedef struct _fc_port_t fc_port_t;
5454
struct _fc_port_t
5555
{
56-
fc_fifo_t *rb[PORT_RB_NUM]; // 环形缓冲
57-
const char *rb_name[PORT_RB_NUM]; // 每个rb缓冲区的名字
58-
fc_phy_io_t phy; // 物理IO接口
59-
6056
// void *user; // 自定义数据
57+
fc_fifo_t *rb[PORT_RB_NUM]; // 环形缓冲
58+
const char *rb_name[PORT_RB_NUM]; // 每个rb缓冲区的名字
59+
fc_phy_io_t phy; // 物理IO接口
60+
uint8_t rb_single_limit[PORT_RB_NUM]; // 单次读写限制(针对慢速IO而言),限制大小为缓冲区空间的1/(2^n),n=rb_single_limit
6161

62-
uint8_t dir; // 方向,用uint8_t而不是枚举(fc_port_dir_t)是为了明确空间大小
63-
uint8_t single_max_shift; // 单次读写限制(针对慢速IO而言),限制大小为缓冲区空间的1/(2^n)
64-
uint8_t trigger_serial; // 连续触发
62+
uint8_t dir; // 方向,用uint8_t而不是枚举(fc_port_dir_t)是为了明确空间大小
6563
};
6664

6765
typedef struct _fc_port_rtt_t fc_port_rtt_t;
@@ -78,36 +76,42 @@ extern "C"
7876

7977
//+********************************* 面向对象 **********************************/
8078
// clang-format off
81-
82-
// 给环形缓冲区指针分配静态内存
83-
#define fc_port_static_alloc_rb(port, rb_index, log2_size, name) \
84-
fc_fifo_static_new_at((port)->rb[rb_index], log2_size); \
85-
(port)->rb_name[rb_index] = name
79+
extern void fc_port_init (fc_port_t *port, fc_port_dir_t dir);
80+
extern void fc_port_catch_fifo (fc_port_t *port, size_t rb_index, fc_fifo_t *fifo, const char *name, uint8_t single_limit);
81+
82+
// 静态内存初始化一个port的环形缓冲区,包括静态内存分配构造,单次读写限制设置等
83+
#define fc_port_static_alloc_rb(port, rb_index, log2_size, name, single_limit) \
84+
do \
85+
{ \
86+
fc_fifo_t *__temp_fifo_ptr = NULL; \
87+
fc_fifo_static_new_at(__temp_fifo_ptr, log2_size); \
88+
fc_port_catch_fifo((port), (rb_index), __temp_fifo_ptr, (name), (single_limit)); \
89+
} while (0)
8690

8791
extern int fc_port_putc (fc_port_t *port, size_t rb_index, int ch);
8892
extern int fc_port_puts (fc_port_t *port, size_t rb_index, const char *str);
8993
extern int fc_port_write (fc_port_t *port, size_t rb_index, const void *buf, size_t len);
9094
extern int fc_port_printf (fc_port_t *port, size_t rb_index, const char *fmt, ...);
9195
extern int fc_port_vprintf(fc_port_t *port, size_t rb_index, const char *fmt, va_list arp); // fc_port_printf核心实现
9296

93-
extern int fc_port_getc(fc_port_t *port, size_t rb_index); // 阻塞式API,非线程安全
97+
extern int fc_port_getc(fc_port_t *port, size_t rb_index); // 阻塞式API
9498
extern char *fc_port_gets(fc_port_t *port, size_t rb_index, char *buf, size_t n); // 不建议使用
9599
extern int fc_port_read(fc_port_t *port, size_t rb_index, void *buf, size_t len); // 读取数据并删除
96100
extern int fc_port_peek(fc_port_t *port, size_t rb_index, void *buf, size_t len); // 读取数据但不删除
97101

98-
extern int fc_port_available(fc_port_t *port, size_t rb_index); // 获取指定缓冲区的已用空间大小
99-
extern int fc_port_free (fc_port_t *port, size_t rb_index); // 获取指定缓冲区的剩余空间大小
100-
// 以下API的行为取决于fc_port_t的方向(fc_port_dir_t)
101-
extern void fc_port_trigger (fc_port_t *port, size_t rb_index); // 触发慢速IO
102-
extern void fc_port_end (fc_port_t *port, size_t rb_index, int size); // 慢速IO完成回调
102+
extern int fc_port_used (fc_port_t *port, size_t rb_index); // 获取指定缓冲区的已用空间大小
103+
extern int fc_port_free (fc_port_t *port, size_t rb_index); // 获取指定缓冲区的剩余空间大小
104+
// 以下API的行为取决于port的方向port->dir
105+
extern void fc_port_trigger (fc_port_t *port, size_t rb_index); // 触发慢速IO
106+
extern void fc_port_end (fc_port_t *port, size_t rb_index, int size); // 慢速IO完成回调
103107

104108
// clang-format on
105109

106110
//+********************************* 提供一份格式化输出到fifo的API **********************************/
107111

108112
// 这两个API使用都需要自行保证fifo的写操作线程安全
109113
extern int fc_fifo_printf(fc_fifo_t *fifo, const char *fmt, ...);
110-
extern int fc_fifo_vprintf(fc_fifo_t *fifo, const char *fmt, va_list arp); // fc_fifo_printf核心实现,在fc_port_vprintf.c中实现
114+
extern int fc_fifo_vprintf(fc_fifo_t *fifo, const char *fmt, va_list arp); // fc_fifo_printf核心实现,在utils/fc_fifo_vprintf.c中实现
111115

112116
//+********************************* 默认实例化对象 **********************************/
113117
// 初始化标准输入输出
@@ -145,10 +149,10 @@ extern "C"
145149
#define fc_printf(fmt, ...) fc_port_printf (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX, fmt, ##__VA_ARGS__)
146150
#define fc_vprintf(fmt, arp) fc_port_vprintf(FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX, fmt, arp)
147151

148-
#define fc_out_trigger() fc_port_trigger (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX) // 触发发送
149-
#define fc_out_end(size) fc_port_end (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX, size) // 发送完成处理
150-
#define fc_out_available() fc_port_available(FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX) // 缓冲区可用字节数
151-
#define fc_out_free() fc_port_free (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX) // 缓冲区剩余空间
152+
#define fc_out_trigger() fc_port_trigger (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX) // 触发发送
153+
#define fc_out_end(size) fc_port_end (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX, size) // 发送完成处理
154+
#define fc_out_used() fc_port_used (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX) // 缓冲区已用空间
155+
#define fc_out_free() fc_port_free (FC_STDOUT_OBJ, FC_STDOUT_RB_INDEX) // 缓冲区剩余空间
152156

153157
/*----------------------------------------------*/
154158
/* Formatted string output */
@@ -176,15 +180,15 @@ extern "C"
176180
*/
177181

178182
// stdin
179-
#define fc_getchar() fc_port_getc(FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 阻塞式API,非线程安全
180-
#define fc_getc() fc_port_getc(FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 阻塞式API,非线程安全
183+
#define fc_getchar() fc_port_getc(FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 阻塞式API
184+
#define fc_getc() fc_port_getc(FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 阻塞式API
181185
#define fc_gets(buf, n) fc_port_gets(FC_STDIN_OBJ, FC_STDIN_RB_INDEX, buf, n) // 不建议使用
182-
#define fc_read(buf, len) fc_port_read(FC_STDIN_OBJ, FC_STDIN_RB_INDEX, buf, len) // 阻塞式API,非线程安全
186+
#define fc_read(buf, len) fc_port_read(FC_STDIN_OBJ, FC_STDIN_RB_INDEX, buf, len) // 阻塞式API
183187

184-
#define fc_in_trigger() fc_port_trigger (FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 触发接收
185-
#define fc_in_end(size) fc_port_end (FC_STDIN_OBJ, FC_STDIN_RB_INDEX, size) // 接收完成处理
186-
#define fc_in_available() fc_port_available(FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 缓冲区可用字节数
187-
#define fc_in_free() fc_port_free (FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 缓冲区剩余空间
188+
#define fc_in_trigger() fc_port_trigger (FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 触发接收
189+
#define fc_in_end(size) fc_port_end (FC_STDIN_OBJ, FC_STDIN_RB_INDEX, size) // 接收完成处理
190+
#define fc_in_used() fc_port_used (FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 缓冲区已用空间
191+
#define fc_in_free() fc_port_free (FC_STDIN_OBJ, FC_STDIN_RB_INDEX) // 缓冲区剩余空间
188192

189193
// clang-format on
190194

core/fc_stdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333

3434
//+********************************* port API **********************************/
3535

36-
#include "./utils/fc_port_vprintf.c"
36+
#include "./utils/fc_fifo_vprintf.c"

core/fc_stdio.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ extern "C"
6868
//! 废弃实现,建议直接使用标准库的
6969

7070
//+********************************* port对接API **********************************/
71-
// 由外层fc_port.h声明
71+
// 在 fc_port.h 声明
7272
// extern int fc_port_vprintf(fc_port_t *port, size_t rb_index, const char *fmt, va_list arp); // 字符串格式化核心函数
73+
// extern int fc_fifo_vprintf(fc_fifo_t *fifo, const char *fmt, va_list arp);
7374

7475
#ifdef __cplusplus
7576
}

core/fc_trans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ void fc_sender_init(fc_sender_t *sender, fc_fifo_t *fifo)
229229
sender->fifo = fifo;
230230
sender->index = 0; // 默认窗口0
231231

232-
fc_fifo_write(sender->fifo, (void *)default_division, sizeof(FC_DIVISION_DEFAULT) - 1); // 写入默认窗口
232+
// fc_fifo_write(sender->fifo, (void *)default_division, sizeof(FC_DIVISION_DEFAULT) - 1); // 写入默认窗口
233233
}
234234

235235
/**

0 commit comments

Comments
 (0)