summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/dac.cpp3
-rw-r--r--src/drivers/include/dac.hpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/drivers/dac.cpp b/src/drivers/dac.cpp
index c9af0d99..4d3aca1d 100644
--- a/src/drivers/dac.cpp
+++ b/src/drivers/dac.cpp
@@ -192,7 +192,8 @@ auto AudioDac::Reconfigure(BitsPerSample bps, SampleRate rate) -> void {
WriteRegister(Register::POWER_MODE, 0);
}
-auto AudioDac::WriteData(cpp::span<std::byte> data) -> std::size_t {
+auto AudioDac::WriteData(const cpp::span<const std::byte>& data)
+ -> std::size_t {
std::size_t bytes_written = 0;
esp_err_t err = i2s_channel_write(i2s_handle_, data.data(), data.size_bytes(),
&bytes_written, 0);
diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp
index 06808a78..028d46cb 100644
--- a/src/drivers/include/dac.hpp
+++ b/src/drivers/include/dac.hpp
@@ -71,7 +71,7 @@ class AudioDac {
// TODO(jacqueline): worth supporting channels here as well?
auto Reconfigure(BitsPerSample bps, SampleRate rate) -> void;
- auto WriteData(cpp::span<std::byte> data) -> std::size_t;
+ auto WriteData(const cpp::span<const std::byte>& data) -> std::size_t;
auto Stop() -> void;
auto LogStatus() -> void;