Skip to content

Commit 92d13a0

Browse files
committed
docs: 新增进阶编程/贡献指南板块,完善 DoubleBuffer API 说明
1 parent abed4f8 commit 92d13a0

File tree

7 files changed

+63
-5
lines changed

7 files changed

+63
-5
lines changed

docs/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: about
33
title: 关于
4-
sidebar_position: 8
4+
sidebar_position: 10
55
---
66

77
# 关于本项目

docs/adv_coding/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
id: adv-coding
3+
title: 进阶编程
4+
sidebar_position: 8
5+
---
6+
7+
# 进阶编程
8+
9+
本章将深入介绍更为底层和高阶的编程主题,包括:
10+
11+
- 驱动开发的底层实现
12+
- IO 与通信机制的原理与优化
13+
- 无锁/高性能数据结构设计
14+
- 代码性能与实时性调优方法
15+
16+
无论你是想开发自己的高性能模块、调试复杂外设,还是对系统底层原理感兴趣,都可以在本章找到实用的技术细节和最佳实践建议。

docs/adv_coding/driver.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
id: adv-coding-driver
3+
title: 驱动设计
4+
sidebar_position: 1
5+
---
6+
7+
# 驱动设计
8+
9+
TODO:

docs/basic_coding/structure/double_buffer.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ explicit DoubleBuffer(const LibXR::RawData& raw_data);
3535
- `void EnablePending()`:手动标记备用区为有效(与 FillActive 配合使用)。
3636
- `bool HasPending() const`:是否存在准备切换的缓冲区。
3737
- `void Switch()`:切换 active/pending 缓冲。
38-
- `size_t PendingLength() const`:获取备用缓冲中的有效数据长度。
38+
- `size_t GetPendingLength() const`:获取备用缓冲中的有效数据长度。
39+
- `size_t SetPendingLength(size_t size)`:设置备用缓冲的有效数据长度。
3940
- `size_t Size() const`:每个缓冲区的容量。
4041
4142
## 使用示例
@@ -64,6 +65,6 @@ buf.EnablePending(); // 标记当前 active 将作为 pending 切换
6465

6566
## 应用场景
6667

67-
- USB CDC / Audio 数据发送
68+
- USB CDC / UART 数据发送
6869
- DMA 数据流优化
6970
- 双缓存 ping-pong 通信机制

docs/con_guide/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
id: adv-coding
3+
title: 贡献指南
4+
sidebar_position: 8
5+
---
6+
7+
# 贡献指南
8+
9+
欢迎你参与本项目的开发与完善!无论你是开发者、文档贡献者,还是用户反馈者,都能在这里找到参与的方式。
10+
有任何问题欢迎在仓库页面提交 Issue,或者加入交流群讨论,我们会及时、友好地回复你的疑问。
11+
12+
本章将介绍如何高效、规范地为本项目贡献代码、文档与建议,主要内容包括:
13+
14+
- 如何参与贡献(Issue、Pull Request、文档完善等)
15+
- LibXR 开发调试流程
16+
- 开发与提交规范
17+
- 代码风格要求
18+
- 常见贡献场景
19+
- 评审与合并流程
20+
- 新手任务指引
21+
22+
我们欢迎各种形式的贡献,也希望所有参与者遵守社区行为规范,共同打造一个开放、专业、高质量的技术社区。

docs/con_guide/how2con.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
id: adv-coding-how2con
3+
title: 如何参与贡献
4+
sidebar_position: 1
5+
---
6+
7+
# 如何参与贡献
8+
9+
TODO:

i18n/en/docusaurus-plugin-content-docs/current/basic_coding/structure/double_buffer.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ explicit DoubleBuffer(const LibXR::RawData& raw_data);
3535
- `void EnablePending()`: Manually mark the pending buffer as valid (used with `FillActive`).
3636
- `bool HasPending() const`: Check if there is a pending buffer ready to be switched.
3737
- `void Switch()`: Switch between active and pending buffers.
38-
- `size_t PendingLength() const`: Get the valid data length in the pending buffer.
38+
- `size_t GetPendingLength() const`: Get the valid data length in the pending buffer.
39+
- `size_t SetPendingLength(size_t size)`: Set the valid data length in the pending buffer.
3940
- `size_t Size() const`: Get the capacity of each buffer.
4041
4142
## Usage Example
@@ -64,6 +65,6 @@ buf.EnablePending(); // Mark the current active as the next pending
6465

6566
## Application Scenarios
6667

67-
- USB CDC / Audio data transmission
68+
- USB CDC / UART data transmission
6869
- Optimized DMA data streaming
6970
- Ping-pong buffering communication mechanism

0 commit comments

Comments
 (0)