mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Merge branch 'PR_18Wifi' of https://github.com/facchinm/Arduino
This commit is contained in:
commit
da243c9e09
@ -32,8 +32,6 @@ uint16_t WiFiClass::_server_port[MAX_SOCK_NUM] = { 0, 0, 0, 0 };
|
||||
|
||||
WiFiClass::WiFiClass()
|
||||
{
|
||||
// Driver initialization
|
||||
init();
|
||||
}
|
||||
|
||||
void WiFiClass::init()
|
||||
|
@ -43,8 +43,8 @@ void SpiDrv::begin()
|
||||
pinMode(SLAVEREADY, INPUT);
|
||||
pinMode(WIFILED, OUTPUT);
|
||||
|
||||
digitalWrite(SCK, LOW);
|
||||
digitalWrite(MOSI, LOW);
|
||||
// digitalWrite(SCK, LOW);
|
||||
// digitalWrite(MOSI, LOW);
|
||||
digitalWrite(SS, HIGH);
|
||||
digitalWrite(SLAVESELECT, HIGH);
|
||||
digitalWrite(WIFILED, LOW);
|
||||
|
@ -30,11 +30,15 @@
|
||||
|
||||
#define DUMMY_DATA 0xFF
|
||||
|
||||
#define WAIT_FOR_SLAVE_SELECT() \
|
||||
SpiDrv::waitForSlaveReady(); \
|
||||
#define WAIT_FOR_SLAVE_SELECT() \
|
||||
if (!initialized) { \
|
||||
SpiDrv::begin(); \
|
||||
initialized = true; \
|
||||
} \
|
||||
SpiDrv::waitForSlaveReady(); \
|
||||
SpiDrv::spiSlaveSelect();
|
||||
|
||||
|
||||
static bool initialized = false;
|
||||
|
||||
class SpiDrv
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user