Skip to content

Commit da243c9

Browse files
committed
Merge branch 'PR_18Wifi' of https://github.com/facchinm/Arduino
2 parents a33c93b + 1fb0f84 commit da243c9

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

libraries/WiFi/src/WiFi.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ uint16_t WiFiClass::_server_port[MAX_SOCK_NUM] = { 0, 0, 0, 0 };
3232

3333
WiFiClass::WiFiClass()
3434
{
35-
// Driver initialization
36-
init();
3735
}
3836

3937
void WiFiClass::init()

libraries/WiFi/src/utility/spi_drv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void SpiDrv::begin()
4343
pinMode(SLAVEREADY, INPUT);
4444
pinMode(WIFILED, OUTPUT);
4545

46-
digitalWrite(SCK, LOW);
47-
digitalWrite(MOSI, LOW);
46+
// digitalWrite(SCK, LOW);
47+
// digitalWrite(MOSI, LOW);
4848
digitalWrite(SS, HIGH);
4949
digitalWrite(SLAVESELECT, HIGH);
5050
digitalWrite(WIFILED, LOW);

libraries/WiFi/src/utility/spi_drv.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030

3131
#define DUMMY_DATA 0xFF
3232

33-
#define WAIT_FOR_SLAVE_SELECT() \
34-
SpiDrv::waitForSlaveReady(); \
33+
#define WAIT_FOR_SLAVE_SELECT() \
34+
if (!initialized) { \
35+
SpiDrv::begin(); \
36+
initialized = true; \
37+
} \
38+
SpiDrv::waitForSlaveReady(); \
3539
SpiDrv::spiSlaveSelect();
3640

37-
41+
static bool initialized = false;
3842

3943
class SpiDrv
4044
{

0 commit comments

Comments
 (0)