adafruit / Adafruit_STMPE610

Arduino library for STMPE610/811 resistive touch screen controllers
MIT License
38 stars 32 forks source link

Adafruit_STMPE610::readRegister8 calls global SPI object vice _spi member #18

Open DarthRust opened 5 years ago

DarthRust commented 5 years ago

-Arduino board: ESP32 HUZZAH Feather -Using VSC Platformio -Create a new STMPE610 object with (int,SPIClass*) constructor, passing an HSPI configured SPIClass, then call being(). The VPSI bus will then get a spurious endTransaction call.

In STMPE610.cpp, Adafruit_STMPE610::readRegister8, lines 284-286 reflect the following.

    if (_CLK == -1)
      SPI.endTransaction();
  }

This is likely transparent when using the default SPI port configured in SPI.h. Replacing line 285 with the below enabled using this library on other ports.

_spi->endTransaction();
ladyada commented 5 years ago

thanks, please submit a PR, we'll check it out!