arduino / arduino/ArduinoCore-API
Trouble with static buffer sizes within the RingBuffer libray
- 主要语言
- C++
- 星标
- 306
- 派生
- 150
- PR 合并指标
- 30 天内没有已合并 PR
描述
(Arduino 1.6.18.1)
- Serial communication:
If serial data are read and the attached device does not support any flow control (like most devices that you can buy) the CPU must be in receive mode all over the time. The data received are buffered in a static preallocated 128 byte buffer SAM) within the Arduino library.
The user application must periodical check if there are data and read them and must do it fast enough, before buffer overflow.
If you do for example SD-card-i/o, the SD-card may awake from sleep mode and that cost a few 100ms, you can quickly get an overflow of the serial buffer.
The only chance to overcome this situation is to align the serial buffer size to your application. If there is no flow control on receive, one cannot use a fixed size for all projects.
Please implement a simple method, that the user can set the size of the buffer from within the project (AVR, SAM, and SAMD(?)).
Currently one must modify (SAM): "Ringbuffer.h" => "#define SERIAL_BUFFER_SIZE xxxxx".
(This topic is currently in discussion within the Arduino group.)
贡献指南
这个仓库没有索引到贡献指南
调研方向
先从 Ringbuffer.h 和 issue 中提到的 SERIAL_BUFFER_SIZE 定义开始,然后比较 Arduino 库在 AVR、SAM 和 SAMD 上如何处理缓冲区。定义项目应如何在不编辑库的情况下设置大小,并验证所选大小在受影响的平台上确实生效。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- arduino, cpp
- 领域
- embedded-iot
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100