Skip to content

Commit 3e87abc

Browse files
committed
2 parents 62fa954 + 3198f25 commit 3e87abc

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

docs/platformio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Installation instructions for using PlatformIO
55

66
- [What is PlatformIO?](http://docs.platformio.org/page/what-is-platformio.html)
77
- [PlatformIO IDE](http://platformio.org/platformio-ide)
8-
- Quick Start with [PlatformIO IDE](http://docs.platformio.org/page/ide/atom.html#quick-start) or [PlatformIO Core](http://docs.platformio.org/page/core.html)
8+
- [PlatformIO Core (CLI)](http://docs.platformio.org/page/core.html)
99
- [Integration with Cloud and Standalone IDEs](http://docs.platformio.org/page/ide.html) -
1010
Cloud9, Codeanywehre, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM and Visual Studio
1111
- [Project Examples](https://github.com/platformio/platform-espressif32/tree/develop/examples)

libraries/SPI/src/SPI.cpp

+11-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,17 @@ void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
4949
return;
5050
}
5151

52-
_sck = sck;
53-
_miso = miso;
54-
_mosi = mosi;
55-
_ss = ss;
52+
if(sck == -1 && miso == -1 && mosi == -1 && ss == -1) {
53+
_sck = (_spi_num == VSPI) ? SCK : 14;
54+
_miso = (_spi_num == VSPI) ? MISO : 12;
55+
_mosi = (_spi_num == VSPI) ? MOSI : 13;
56+
_ss = (_spi_num == VSPI) ? SS : 15;
57+
} else {
58+
_sck = sck;
59+
_miso = miso;
60+
_mosi = mosi;
61+
_ss = ss;
62+
}
5663

5764
spiAttachSCK(_spi, _sck);
5865
spiAttachMISO(_spi, _miso);

libraries/SPI/src/SPI.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SPIClass
5252

5353
public:
5454
SPIClass(uint8_t spi_bus=HSPI);
55-
void begin(int8_t sck=SCK, int8_t miso=MISO, int8_t mosi=MOSI, int8_t ss=-1);
55+
void begin(int8_t sck=-1, int8_t miso=-1, int8_t mosi=-1, int8_t ss=-1);
5656
void end();
5757

5858
void setHwCs(bool use);

0 commit comments

Comments
 (0)