1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

WiFi librari: SPI delay is computed based on F_CPU constant

This commit is contained in:
Cristian Maglie 2013-12-10 18:59:45 +01:00
parent a2482734b5
commit 1ddf6136af
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ extern "C" {
#define SLAVEREADY 7 // handshake pin
#define WIFILED 9 // led on wifi shield
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < X); }
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < (X*F_CPU/16000000)); }
#define DELAY_TRANSFER() DELAY_SPI(10)
void SpiDrv::begin()

View File

@ -15,7 +15,7 @@ extern "C" {
#define SLAVEREADY 7 // handshake pin
#define WIFILED 9 // led on wifi shield
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < X*6); }
#define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < (X*F_CPU/16000000)); }
#define DELAY_TRANSFER() DELAY_SPI(10)
void SpiDrv::begin()