mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(sdmmc): correct power init in CD/WP tests for P4
This commit is contained in:
parent
ad51d0d1ca
commit
96074470ec
@ -21,6 +21,17 @@ TEST_CASE("CD input works in SD mode", "[sdmmc]")
|
||||
sdmmc_test_board_get_config_sdmmc(SDMMC_HOST_SLOT_1, &config, &slot_config);
|
||||
const int test_gpio = sdmmc_test_board_get_slot_info(SDMMC_HOST_SLOT_1)->unused_pin;
|
||||
slot_config.gpio_cd = test_gpio;
|
||||
#if SOC_SDMMC_IO_POWER_EXTERNAL
|
||||
#define SDMMC_PWR_LDO_CHANNEL 4
|
||||
sd_pwr_ctrl_ldo_config_t ldo_config = {
|
||||
.ldo_chan_id = SDMMC_PWR_LDO_CHANNEL,
|
||||
};
|
||||
sd_pwr_ctrl_handle_t pwr_ctrl_handle = NULL;
|
||||
|
||||
TEST_ESP_OK(sd_pwr_ctrl_new_on_chip_ldo(&ldo_config, &pwr_ctrl_handle));
|
||||
config.pwr_ctrl_handle = pwr_ctrl_handle;
|
||||
#endif
|
||||
|
||||
sdmmc_test_board_card_power_set(true);
|
||||
TEST_ESP_OK(sdmmc_host_init());
|
||||
TEST_ESP_OK(sdmmc_host_init_slot(SDMMC_HOST_SLOT_1, &slot_config));
|
||||
@ -42,6 +53,17 @@ TEST_CASE("WP input works in SD mode", "[sdmmc]")
|
||||
sdmmc_test_board_get_config_sdmmc(SDMMC_HOST_SLOT_1, &config, &slot_config);
|
||||
const int test_gpio = sdmmc_test_board_get_slot_info(SDMMC_HOST_SLOT_1)->unused_pin;
|
||||
slot_config.gpio_wp = test_gpio;
|
||||
#if SOC_SDMMC_IO_POWER_EXTERNAL
|
||||
#define SDMMC_PWR_LDO_CHANNEL 4
|
||||
sd_pwr_ctrl_ldo_config_t ldo_config = {
|
||||
.ldo_chan_id = SDMMC_PWR_LDO_CHANNEL,
|
||||
};
|
||||
sd_pwr_ctrl_handle_t pwr_ctrl_handle = NULL;
|
||||
|
||||
TEST_ESP_OK(sd_pwr_ctrl_new_on_chip_ldo(&ldo_config, &pwr_ctrl_handle));
|
||||
config.pwr_ctrl_handle = pwr_ctrl_handle;
|
||||
#endif
|
||||
|
||||
TEST_ESP_OK(sdmmc_host_init());
|
||||
TEST_ESP_OK(sdmmc_host_init_slot(SDMMC_HOST_SLOT_1, &slot_config));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user