1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Hardware SPI BREAKING: unswap mode 2 and 3 for portability (#5948)

* Hardware SPI BREAKING: unswap mode 2 and 3 for portability
use SPI.restoreEsp8266LegacyMode2And3() for former behaviour
This commit is contained in:
david gauchard
2019-04-06 01:13:09 +02:00
committed by GitHub
parent a1796f455a
commit 77451d6ec9

View File

@ -161,6 +161,11 @@ void SPIClass::setDataMode(uint8_t dataMode) {
bool CPOL = (dataMode & 0x10); ///< CPOL (Clock Polarity)
bool CPHA = (dataMode & 0x01); ///< CPHA (Clock Phase)
// https://github.com/esp8266/Arduino/issues/2416
// https://github.com/esp8266/Arduino/pull/2418
if(CPOL) // Ensure same behavior as
CPHA ^= 1; // SAM, AVR and Intel Boards
if(CPHA) {
SPI1U |= (SPIUSME);
} else {