fix(spi_master): fix the CS pin issue with GPIO 0.

Closes #909
This commit is contained in:
michael 2017-11-15 15:31:22 +08:00
parent 842292523f
commit 57e1d47ad7

View file

@ -270,7 +270,7 @@ esp_err_t spi_bus_add_device(spi_host_device_t host, spi_device_interface_config
memcpy(&dev->cfg, dev_config, sizeof(spi_device_interface_config_t));
//Set CS pin, CS options
if (dev_config->spics_io_num > 0) {
if (dev_config->spics_io_num >= 0) {
gpio_set_direction(dev_config->spics_io_num, GPIO_MODE_OUTPUT);
spicommon_cs_initialize(host, dev_config->spics_io_num, freecs, spihost[host]->no_gpio_matrix == false);
}