From 7083459cf3c62c32d0c039a4665e702d70a27bba Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 21 Apr 2023 15:27:57 +1000 Subject: wrap driver instance ownership + di in a class --- src/drivers/include/dac.hpp | 3 +-- src/drivers/include/display.hpp | 3 +-- src/drivers/include/storage.hpp | 7 +++---- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src/drivers/include') diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp index acdd1743..4952c992 100644 --- a/src/drivers/include/dac.hpp +++ b/src/drivers/include/dac.hpp @@ -117,8 +117,7 @@ class AudioDac { FAILED_TO_INSTALL_I2S, }; - static auto create(GpioExpander* expander) - -> cpp::result, Error>; + static auto create(GpioExpander* expander) -> cpp::result; AudioDac(GpioExpander* gpio, i2s_chan_handle_t i2s_handle); ~AudioDac(); diff --git a/src/drivers/include/display.hpp b/src/drivers/include/display.hpp index 8157c3a5..9e4a0224 100644 --- a/src/drivers/include/display.hpp +++ b/src/drivers/include/display.hpp @@ -23,8 +23,7 @@ class Display { * us back any kind of signal to tell us we're actually using them correctly. */ static auto create(GpioExpander* expander, - const displays::InitialisationData& init_data) - -> std::unique_ptr; + const displays::InitialisationData& init_data) -> Display*; Display(GpioExpander* gpio, spi_device_handle_t handle); ~Display(); diff --git a/src/drivers/include/storage.hpp b/src/drivers/include/storage.hpp index 64ce4782..c19ec935 100644 --- a/src/drivers/include/storage.hpp +++ b/src/drivers/include/storage.hpp @@ -25,14 +25,13 @@ class SdStorage { FAILED_TO_MOUNT, }; - static auto create(GpioExpander* gpio) - -> cpp::result, Error>; + static auto create(GpioExpander* gpio) -> cpp::result; SdStorage(GpioExpander* gpio, esp_err_t (*do_transaction)(sdspi_dev_handle_t, sdmmc_command_t*), sdspi_dev_handle_t handle_, - std::unique_ptr& host_, - std::unique_ptr& card_, + std::unique_ptr host_, + std::unique_ptr card_, FATFS* fs_); ~SdStorage(); -- cgit v1.2.3