[core] Support allocating ring buffer in internal memory (#16187)

This commit is contained in:
Kevin Ahrendt
2026-05-01 07:55:08 -05:00
committed by GitHub
parent f073c1cabe
commit 3dd60c5713
2 changed files with 13 additions and 7 deletions
+6 -1
View File
@@ -80,7 +80,12 @@ class RingBuffer {
*/
BaseType_t reset();
static std::unique_ptr<RingBuffer> create(size_t len);
enum class MemoryPreference {
EXTERNAL_FIRST, // External RAM preferred, fall back to internal (default)
INTERNAL_FIRST, // Internal RAM preferred, fall back to external
};
static std::unique_ptr<RingBuffer> create(size_t len, MemoryPreference preference = MemoryPreference::EXTERNAL_FIRST);
protected:
/// @brief Discards data from the ring buffer.