Skip to content

Commit

Permalink
Fix SPI device getting pin config (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSoundy authored Jul 31, 2019
1 parent aaf2b75 commit fd97dac
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ void Esp32_Spi_UnitializeAll()
// Inialise the SPI Bus
static void InitSpiBus( spi_host_device_t bus)
{
gpio_num_t mosiPin = (gpio_num_t)Esp32_GetMappedDevicePins( DEV_TYPE_SPI, bus, 0);
gpio_num_t misoPin = (gpio_num_t)Esp32_GetMappedDevicePins( DEV_TYPE_SPI, bus, 1);
gpio_num_t clockPin = (gpio_num_t)Esp32_GetMappedDevicePins( DEV_TYPE_SPI, bus, 2);
int busIndex = bus - 1;

gpio_num_t mosiPin = (gpio_num_t)Esp32_GetMappedDevicePins( DEV_TYPE_SPI, busIndex, 0);
gpio_num_t misoPin = (gpio_num_t)Esp32_GetMappedDevicePins( DEV_TYPE_SPI, busIndex, 1);
gpio_num_t clockPin = (gpio_num_t)Esp32_GetMappedDevicePins( DEV_TYPE_SPI, busIndex, 2);

spi_bus_config_t bus_config
{
Expand Down

0 comments on commit fd97dac

Please sign in to comment.