diff options
| author | jacqueline <me@jacqueline.id.au> | 2022-10-12 12:06:37 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2022-10-12 12:06:37 +1100 |
| commit | 3726fb750a3f92e1bc9dc25995b8c52bfb5a5d5a (patch) | |
| tree | 69bc7ca858663d10282c1d4cbb5513b70457ded9 /main/storage.cpp | |
| parent | efd5392f6cf2149369d7d3170400bbe8f2d5c82e (diff) | |
| download | tangara-fw-3726fb750a3f92e1bc9dc25995b8c52bfb5a5d5a.tar.gz | |
standardise on formatting
Diffstat (limited to 'main/storage.cpp')
| -rw-r--r-- | main/storage.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/main/storage.cpp b/main/storage.cpp index d2f88894..92c60693 100644 --- a/main/storage.cpp +++ b/main/storage.cpp @@ -19,7 +19,7 @@ namespace gay_ipod { static const char* TAG = "SDSTORAGE"; -SdStorage::SdStorage(GpioExpander *gpio) { +SdStorage::SdStorage(GpioExpander* gpio) { this->gpio_ = gpio; } @@ -33,12 +33,12 @@ SdStorage::Error SdStorage::Acquire(void) { sdspi_host_init(); sdspi_device_config_t config = { - .host_id = VSPI_HOST, - // CS handled manually bc it's on the GPIO expander - .gpio_cs = GPIO_NUM_2, - .gpio_cd = SDSPI_SLOT_NO_CD, - .gpio_wp = SDSPI_SLOT_NO_WP, - .gpio_int = GPIO_NUM_NC, + .host_id = VSPI_HOST, + // CS handled manually bc it's on the GPIO expander + .gpio_cs = GPIO_NUM_2, + .gpio_cd = SDSPI_SLOT_NO_CD, + .gpio_wp = SDSPI_SLOT_NO_WP, + .gpio_int = GPIO_NUM_NC, }; ESP_ERROR_CHECK(sdspi_host_init_device(&config, &handle_)); @@ -49,7 +49,8 @@ SdStorage::Error SdStorage::Acquire(void) { // with our own that acquires the CS mutex for the duration of the SPI // transaction. auto src = host_.do_transaction; - sdspi::do_transaction_wrapper = [=](sdspi_dev_handle_t handle, sdmmc_command_t *cmd) -> esp_err_t { + sdspi::do_transaction_wrapper = [=](sdspi_dev_handle_t handle, + sdmmc_command_t* cmd) -> esp_err_t { auto lock = gpio_->AcquireSpiBus(GpioExpander::SD_CARD); return src(handle, cmd); }; @@ -88,4 +89,4 @@ void SdStorage::Release(void) { sdspi_host_deinit(); } -} // namespace gay_ipod +} // namespace gay_ipod |
