arduino / arduino/ArduinoCore-API
Public API to increase buffer sizes
- 主要语言
- C++
- 星标
- 306
- 派生
- 150
- PR 合并指标
- 30 天内没有已合并 PR
描述
The need for Arduino sketches to increase buffer sizes, particularly for HardwareSerial and the Wire library, has been discussed many times.
A mail list thread on May 3-4, 2017 and subsequent github work on a branch on @facchinm's repository ultimately lead to making the RingBuffer class template based: https://github.com/arduino/ArduinoCore-samd/pull/298. While beautiful internally, this is not a public API. Inside HardwareSerial.h, the RingBuffer instance is private. The size is also hidden by a typedef, further obscuring the possibility of increasing the buffer, even from someone so bold as to edit the private class members.
A public API which can actually be used from Arduino sketches & libraries is needed. It needs to be implemented in all Arduino cores, with do-nothing functions in cores which doesn't support variable buffer size, so end users can actually use the public API in their sketches and share their source code with confidence it will at least compile on all other boards.
Previous conversations have involved overloading begin(), perhaps using special classes to represent buffers, and adding functions like addMemory(), addMemoryForWrite(), addStorageForWrite(), addMemoryForRead() to allow users to increase or replace buffer memory at runtime.
But previous work has always stalled far short of actually providing a public API which can actually be used throughout the Arduino ecosystem. A public API which people can actually use without editing the core library or Wire library really is needed.
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先检查 HardwareSerial.h、private RingBuffer 实例和 typedef,然后对比 ArduinoCore-samd 的 pull request 298 中基于 template 的工作。设计必须提供一个公共的缓冲区大小配置 API,使其能够从所有 Arduino core 中的 sketch 和库使用;对于无法改变缓冲区大小的 core,则采用 no-op 行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- cpp
- 领域
- api, embedded-iot
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100