File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
libraries/Ethernet/src/utility Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 12
12
13
13
#include < SPI.h>
14
14
15
- #define SPI_CS 10
16
-
17
- #if !defined(SPI_HAS_EXTENDED_CS_PIN_HANDLING)
18
- #define SPI_ETHERNET_SETTINGS SPISettings (4000000 , MSBFIRST, SPI_MODE0)
19
- #else
20
- #define SPI_ETHERNET_SETTINGS SPI_CS,SPISettings(4000000 , MSBFIRST, SPI_MODE0)
21
- #endif
15
+ #define ETHERNET_SHIELD_SPI_CS 10
22
16
23
17
#define MAX_SOCK_NUM 4
24
18
@@ -331,6 +325,7 @@ class W5100Class {
331
325
332
326
private:
333
327
#if !defined(SPI_HAS_EXTENDED_CS_PIN_HANDLING)
328
+ #define SPI_ETHERNET_SETTINGS SPISettings (4000000 , MSBFIRST, SPI_MODE0)
334
329
#if defined (__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
335
330
inline static void initSS() { DDRB |= _BV (4 ); };
336
331
inline static void setSS () { PORTB &= ~_BV (4 ); };
@@ -348,7 +343,10 @@ class W5100Class {
348
343
inline static void setSS () { PORTB &= ~_BV (2 ); };
349
344
inline static void resetSS () { PORTB |= _BV (2 ); };
350
345
#endif
351
- #endif // !SPI_HAS_EXTENDED_CS_PIN_HANDLING
346
+ #else
347
+ #define SPI_ETHERNET_SETTINGS ETHERNET_SHIELD_SPI_CS,SPISettings(4000000 , MSBFIRST, SPI_MODE0)
348
+ // initSS(), setSS(), resetSS() not needed with EXTENDED_CS_PIN_HANDLING
349
+ #endif
352
350
};
353
351
354
352
extern W5100Class W5100;
You can’t perform that action at this time.
0 commit comments