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:
Flavio Bayer 2018-04-13 16:34:23 -03:00 committed by Angus Gratton
parent 6c44fc70bc
commit d477d3c5bd

View File

@ -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) {
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 {
s_slots[slot].gpio_wp = GPIO_UNUSED;
s_slots[slot].gpio_cd = GPIO_UNUSED;
}
if (slot_config->gpio_wp != SDSPI_SLOT_NO_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 {
s_slots[slot].gpio_cd = GPIO_UNUSED;
s_slots[slot].gpio_wp = GPIO_UNUSED;
}
if (io_conf.pin_bit_mask != 0) {