From a65d996583c72e0d77805bcbc36da580aacb2848 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 14 Feb 2023 14:30:53 +1100 Subject: Use the sync apis for I2S output --- src/drivers/include/dac.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/drivers/include') diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp index 698019b7..e682d8d7 100644 --- a/src/drivers/include/dac.hpp +++ b/src/drivers/include/dac.hpp @@ -10,6 +10,7 @@ #include "driver/i2s_std.h" #include "driver/i2s_types.h" #include "esp_err.h" +#include "freertos/FreeRTOS.h" #include "freertos/portmacro.h" #include "result.hpp" #include "span.hpp" @@ -67,10 +68,9 @@ class AudioDac { }; // TODO(jacqueline): worth supporting channels here as well? - auto Reconfigure(BitsPerSample bps, SampleRate rate, QueueHandle_t dma_queue) - -> std::size_t; + auto Reconfigure(BitsPerSample bps, SampleRate rate) -> void; - auto WriteDataFromISR(std::byte* data, std::size_t size) -> bool; + auto WriteData(cpp::span data) -> std::size_t; // Not copyable or movable. AudioDac(const AudioDac&) = delete; @@ -83,9 +83,6 @@ class AudioDac { i2s_std_clk_config_t clock_config_; i2s_std_slot_config_t slot_config_; - // TODO: volatile? - volatile QueueHandle_t dma_queue_; - /* * Pools the power state for up to 10ms, waiting for the given predicate to * be true. -- cgit v1.2.3