mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
bugfix/sdspi_host.c: wrong CD/WP pin configuration
Looks like the configuration of CP and WP pins are wrong, since the check for `gpio_cd` and `gpio_wp` in `slot_config` seems to be swapped.
This commit is contained in:
committed by
Angus Gratton
parent
6c44fc70bc
commit
d477d3c5bd
@@ -316,16 +316,16 @@ esp_err_t sdspi_host_init_slot(int slot, const sdspi_slot_config_t* slot_config)
|
|||||||
};
|
};
|
||||||
if (slot_config->gpio_cd != SDSPI_SLOT_NO_CD) {
|
if (slot_config->gpio_cd != SDSPI_SLOT_NO_CD) {
|
||||||
io_conf.pin_bit_mask |= (1 << slot_config->gpio_cd);
|
io_conf.pin_bit_mask |= (1 << slot_config->gpio_cd);
|
||||||
s_slots[slot].gpio_wp = slot_config->gpio_wp;
|
s_slots[slot].gpio_cd = slot_config->gpio_cd;
|
||||||
} else {
|
} else {
|
||||||
s_slots[slot].gpio_wp = GPIO_UNUSED;
|
s_slots[slot].gpio_cd = GPIO_UNUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slot_config->gpio_wp != SDSPI_SLOT_NO_WP) {
|
if (slot_config->gpio_wp != SDSPI_SLOT_NO_WP) {
|
||||||
io_conf.pin_bit_mask |= (1 << slot_config->gpio_wp);
|
io_conf.pin_bit_mask |= (1 << slot_config->gpio_wp);
|
||||||
s_slots[slot].gpio_cd = slot_config->gpio_cd;
|
s_slots[slot].gpio_wp = slot_config->gpio_wp;
|
||||||
} else {
|
} else {
|
||||||
s_slots[slot].gpio_cd = GPIO_UNUSED;
|
s_slots[slot].gpio_wp = GPIO_UNUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (io_conf.pin_bit_mask != 0) {
|
if (io_conf.pin_bit_mask != 0) {
|
||||||
|
Reference in New Issue
Block a user