arduino / arduino/ArduinoCore-API

Public API to increase buffer sizes

Aperta
#115 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
306
Fork
150
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia esaminando HardwareSerial.h, l’istanza privata di RingBuffer e il typedef, quindi confronta il lavoro basato su template nella pull request 298 di ArduinoCore-samd. Il design deve fornire un’API pubblica per la configurazione delle dimensioni del buffer, utilizzabile dagli sketch e dalle librerie su tutti gli Arduino core, con un comportamento no-op sui core che non possono variare le dimensioni dei buffer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
api, embedded-iot
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.