Skip to content

Commit 14893f5

Browse files
committed
Fixed Wifi library for Arduino Due
1 parent b5d2644 commit 14893f5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

hardware/arduino/sam/libraries/WiFi/utility/spi_drv.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ extern "C" {
1515
#define SLAVEREADY 7 // handshake pin
1616
#define WIFILED 9 // led on wifi shield
1717

18-
#define DELAY_100NS do { asm volatile("nop"); }while(0);
19-
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); }while(++ii<X);}
18+
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < X*6); }
2019
#define DELAY_TRANSFER() DELAY_SPI(10)
2120

2221
void SpiDrv::begin()
2322
{
24-
// pinMode(SCK, OUTPUT);
25-
// pinMode(MOSI, OUTPUT);
26-
// pinMode(SS, OUTPUT);
27-
2823
SPI.begin();
2924
pinMode(SLAVESELECT, OUTPUT);
3025
pinMode(SLAVEREADY, INPUT);
@@ -69,11 +64,6 @@ void SpiDrv::spiSlaveDeselect()
6964
char SpiDrv::spiTransfer(volatile char data)
7065
{
7166
char result = SPI.transfer(data);
72-
// SPDR = data; // Start the transmission
73-
// while (!(SPSR & (1<<SPIF))) // Wait the end of the transmission
74-
// {
75-
// };
76-
// char result = SPDR;
7767
DELAY_TRANSFER();
7868

7969
return result; // return the received byte

0 commit comments

Comments
 (0)