arduino / arduino/ArduinoCore-API
Add flushReceiveBuffer() to HardwareSerial
未关闭
- 主要语言
- C++
- 星标
- 306
- 派生
- 150
- PR 合并指标
- 30 天内没有已合并 PR
描述
In Serial communication sometimes one wants to flush all data in the receive buffer at once. E.g. because data has become invalid. - https://forum.arduino.cc/index.php?topic=530650 -
The code to do this very fast in HardwareSerial is straightforward,
```
void HardwareSerial::flushReceiveBuffer()
{
_rx_buffer_head = _rx_buffer_tail;
}
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先定位 HardwareSerial 的声明及其现有的 flush 相关实现或测试。检查接收缓冲区的表示方式,以及如何测试公共 API 的新增内容;当 API 提供 flushReceiveBuffer() 且调用它会丢弃当前缓冲的所有接收数据时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- api, embedded-iot
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100