Skip to content

Commit 832b20d

Browse files
committed
rg_storage: Do not check for NC when using RG_STORAGE_SDSPI_HOLD_CS
It's implied that it's present...
1 parent 6678345 commit 832b20d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

components/retro-go/rg_storage.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,11 @@ void rg_storage_init(void)
9595

9696
// If we're using esp-idf >= 5.0 and the SPI bus is not shared, we must keep the SD card selected
9797
// to work around slow accesses. (https://github.com/espressif/esp-idf/issues/10493)
98-
#ifdef RG_STORAGE_SDSPI_HOLD_CS /* ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) */
99-
if (RG_STORAGE_SDSPI_HOST != RG_SCREEN_HOST && RG_GPIO_SDSPI_CS != GPIO_NUM_NC)
100-
{
101-
gpio_set_direction(RG_GPIO_SDSPI_CS, GPIO_MODE_OUTPUT);
102-
gpio_set_level(RG_GPIO_SDSPI_CS, 0);
103-
slot_config.gpio_cs = GPIO_NUM_NC;
104-
}
105-
#endif
98+
#ifdef RG_STORAGE_SDSPI_HOLD_CS
99+
gpio_set_direction(slot_config.gpio_cs, GPIO_MODE_OUTPUT);
100+
gpio_set_level(slot_config.gpio_cs, 0);
101+
slot_config.gpio_cs = GPIO_NUM_NC;
102+
#endif
106103

107104
esp_vfs_fat_mount_config_t mount_config = {
108105
.format_if_mount_failed = false,

0 commit comments

Comments
 (0)