File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed
hardware/arduino/sam/libraries/WiFi/utility Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,11 @@ extern "C" {
15
15
#define SLAVEREADY 7 // handshake pin
16
16
#define WIFILED 9 // led on wifi shield
17
17
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 ); }
20
19
#define DELAY_TRANSFER () DELAY_SPI(10 )
21
20
22
21
void SpiDrv::begin ()
23
22
{
24
- // pinMode(SCK, OUTPUT);
25
- // pinMode(MOSI, OUTPUT);
26
- // pinMode(SS, OUTPUT);
27
-
28
23
SPI.begin ();
29
24
pinMode (SLAVESELECT, OUTPUT);
30
25
pinMode (SLAVEREADY, INPUT);
@@ -69,11 +64,6 @@ void SpiDrv::spiSlaveDeselect()
69
64
char SpiDrv::spiTransfer (volatile char data)
70
65
{
71
66
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;
77
67
DELAY_TRANSFER ();
78
68
79
69
return result; // return the received byte
You can’t perform that action at this time.
0 commit comments