Skip to content

Commit f12a52e

Browse files
Fixes
1 parent dbefa0a commit f12a52e

7 files changed

Lines changed: 20 additions & 1 deletion

File tree

Platforms/platform-esp32/include/tactility/drivers/esp32_sdmmc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
#pragma once
3+
#if SOC_SDMMC_HOST_SUPPORTED
34

45
#include <sd_protocol_types.h>
56
#include <stdbool.h>
@@ -33,3 +34,5 @@ sdmmc_card_t* esp32_sdmmc_get_card(struct Device* device);
3334
#ifdef __cplusplus
3435
}
3536
#endif
37+
38+
#endif

Platforms/platform-esp32/private/tactility/drivers/esp32_sdmmc_fs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
#pragma once
3+
#if SOC_SDMMC_HOST_SUPPORTED
34
#include <tactility/filesystem/file_system.h>
45

56
#ifdef __cplusplus
@@ -20,3 +21,5 @@ extern const FileSystemApi esp32_sdmmc_fs_api;
2021
#ifdef __cplusplus
2122
}
2223
#endif
24+
25+
#endif

Platforms/platform-esp32/source/drivers/esp32_sdmmc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2+
#if SOC_SDMMC_HOST_SUPPORTED
23
#include <tactility/device.h>
34
#include <tactility/drivers/esp32_sdmmc.h>
45
#include <tactility/drivers/esp32_sdmmc_fs.h>
@@ -159,3 +160,4 @@ Driver esp32_sdmmc_driver = {
159160
};
160161

161162
} // extern "C"
163+
#endif

Platforms/platform-esp32/source/drivers/esp32_sdmmc_fs.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2+
#if SOC_SDMMC_HOST_SUPPORTED
23
#include <tactility/device.h>
34
#include <tactility/drivers/esp32_sdmmc.h>
45
#include <tactility/drivers/esp32_sdmmc_fs.h>
@@ -175,3 +176,4 @@ const FileSystemApi esp32_sdmmc_fs_api = {
175176
};
176177

177178
} // extern "C"
179+
#endif

Platforms/platform-esp32/source/module.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ extern "C" {
77
extern Driver esp32_gpio_driver;
88
extern Driver esp32_i2c_driver;
99
extern Driver esp32_i2s_driver;
10+
#if SOC_SDMMC_HOST_SUPPORTED
1011
extern Driver esp32_sdmmc_driver;
11-
extern Driver esp32_sdmmc_fs_driver;
12+
#endif
1213
extern Driver esp32_spi_driver;
1314
extern Driver esp32_uart_driver;
1415

@@ -18,7 +19,9 @@ static error_t start() {
1819
check(driver_construct_add(&esp32_gpio_driver) == ERROR_NONE);
1920
check(driver_construct_add(&esp32_i2c_driver) == ERROR_NONE);
2021
check(driver_construct_add(&esp32_i2s_driver) == ERROR_NONE);
22+
#if SOC_SDMMC_HOST_SUPPORTED
2123
check(driver_construct_add(&esp32_sdmmc_driver) == ERROR_NONE);
24+
#endif
2225
check(driver_construct_add(&esp32_spi_driver) == ERROR_NONE);
2326
check(driver_construct_add(&esp32_uart_driver) == ERROR_NONE);
2427
return ERROR_NONE;
@@ -30,7 +33,9 @@ static error_t stop() {
3033
check(driver_remove_destruct(&esp32_gpio_driver) == ERROR_NONE);
3134
check(driver_remove_destruct(&esp32_i2c_driver) == ERROR_NONE);
3235
check(driver_remove_destruct(&esp32_i2s_driver) == ERROR_NONE);
36+
#if SOC_SDMMC_HOST_SUPPORTED
3337
check(driver_remove_destruct(&esp32_sdmmc_driver) == ERROR_NONE);
38+
#endif
3439
check(driver_remove_destruct(&esp32_spi_driver) == ERROR_NONE);
3540
check(driver_remove_destruct(&esp32_uart_driver) == ERROR_NONE);
3641
return ERROR_NONE;

Tactility/Source/hal/sdcard/SdCardDevice.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <tactility/filesystem/file_system.h>
44

5+
#include <cstring>
6+
57
namespace tt::hal::sdcard {
68

79
static error_t mount(void* data) {

Tactility/Source/hal/usb/Usb.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ sdmmc_card_t* getCard() {
3434
}
3535
}
3636

37+
#if SOC_SDMMC_HOST_SUPPORTED
3738
// Find ESP32 SDMMC device:
3839
if (sdcard == nullptr) {
3940
device_for_each(&sdcard, [](auto* device, void* context) {
@@ -45,6 +46,7 @@ sdmmc_card_t* getCard() {
4546
return true;
4647
});
4748
}
49+
#endif
4850

4951
if (sdcard == nullptr) {
5052
LOGGER.warn("Couldn't find a mounted SD card");

0 commit comments

Comments
 (0)