@@ -528,8 +528,8 @@ void Adafruit_SPITFT::initSPI(uint32_t freq, uint8_t spiMode) {
528528 hwspi.settings = SPISettings (freq, MSBFIRST, spiMode);
529529#else
530530 hwspi._freq = freq; // Save freq value for later
531- hwspi._mode = spiMode; // Save spiMode value for later
532531#endif
532+ hwspi._mode = spiMode; // Save spiMode value for later
533533 // Call hwspi._spi->begin() ONLY if this is among the 'established'
534534 // SPI interfaces in variant.h. For DIY roll-your-own SERCOM SPIs,
535535 // begin() and pinPeripheral() calls MUST be made in one's calling
@@ -1033,7 +1033,7 @@ void Adafruit_SPITFT::writePixels(uint16_t *colors, uint32_t len,
10331033 #if defined(__SAMD51__) || defined(_SAMD21_)
10341034 if (connection == TFT_HARD_SPI) {
10351035 // See SAMD51/21 note in writeColor()
1036- hwspi._spi ->setDataMode (SPI_MODE0 );
1036+ hwspi._spi ->setDataMode (hwspi. _mode );
10371037 } else {
10381038 pinPeripheral (tft8._wr , PIO_OUTPUT); // Switch WR back to GPIO
10391039 }
@@ -1062,7 +1062,7 @@ void Adafruit_SPITFT::dmaWait(void) {
10621062 #if defined(__SAMD51__) || defined(_SAMD21_)
10631063 if (connection == TFT_HARD_SPI) {
10641064 // See SAMD51/21 note in writeColor()
1065- hwspi._spi ->setDataMode (SPI_MODE0 );
1065+ hwspi._spi ->setDataMode (hwspi. _mode );
10661066 } else {
10671067 pinPeripheral (tft8._wr , PIO_OUTPUT); // Switch WR back to GPIO
10681068 }
@@ -1188,7 +1188,7 @@ void Adafruit_SPITFT::writeColor(uint16_t color, uint32_t len) {
11881188 // state on completion. Workaround is to explicitly set it back...
11891189 // (5/17/2019: apparently SAMD21 too, in certain cases, observed
11901190 // with ST7789 display.)
1191- hwspi._spi ->setDataMode (SPI_MODE0 );
1191+ hwspi._spi ->setDataMode (hwspi. _mode );
11921192 } else {
11931193 pinPeripheral (tft8._wr , PIO_OUTPUT); // Switch WR back to GPIO
11941194 }
0 commit comments