mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +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:
parent
a1796f455a
commit
77451d6ec9
@ -161,6 +161,11 @@ void SPIClass::setDataMode(uint8_t dataMode) {
|
|||||||
bool CPOL = (dataMode & 0x10); ///< CPOL (Clock Polarity)
|
bool CPOL = (dataMode & 0x10); ///< CPOL (Clock Polarity)
|
||||||
bool CPHA = (dataMode & 0x01); ///< CPHA (Clock Phase)
|
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) {
|
if(CPHA) {
|
||||||
SPI1U |= (SPIUSME);
|
SPI1U |= (SPIUSME);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user