|
14 | 14 |
|
15 | 15 | #define SPI_CS 10
|
16 | 16 |
|
17 |
| -#if defined(ARDUINO_ARCH_AVR) |
| 17 | +#if !defined(SPI_HAS_EXTENDED_CS_PIN_HANDLING) |
18 | 18 | #define SPI_ETHERNET_SETTINGS SPISettings(4000000, MSBFIRST, SPI_MODE0)
|
19 | 19 | #else
|
20 | 20 | #define SPI_ETHERNET_SETTINGS SPI_CS,SPISettings(4000000, MSBFIRST, SPI_MODE0)
|
@@ -330,25 +330,25 @@ class W5100Class {
|
330 | 330 | uint16_t RBASE[SOCKETS]; // Rx buffer base address
|
331 | 331 |
|
332 | 332 | private:
|
333 |
| -#if defined(ARDUINO_ARCH_AVR) |
334 |
| -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) |
335 |
| - inline static void initSS() { DDRB |= _BV(4); }; |
336 |
| - inline static void setSS() { PORTB &= ~_BV(4); }; |
337 |
| - inline static void resetSS() { PORTB |= _BV(4); }; |
338 |
| -#elif defined(__AVR_ATmega32U4__) |
339 |
| - inline static void initSS() { DDRB |= _BV(6); }; |
340 |
| - inline static void setSS() { PORTB &= ~_BV(6); }; |
341 |
| - inline static void resetSS() { PORTB |= _BV(6); }; |
342 |
| -#elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB162__) |
343 |
| - inline static void initSS() { DDRB |= _BV(0); }; |
344 |
| - inline static void setSS() { PORTB &= ~_BV(0); }; |
345 |
| - inline static void resetSS() { PORTB |= _BV(0); }; |
346 |
| -#else |
347 |
| - inline static void initSS() { DDRB |= _BV(2); }; |
348 |
| - inline static void setSS() { PORTB &= ~_BV(2); }; |
349 |
| - inline static void resetSS() { PORTB |= _BV(2); }; |
350 |
| -#endif |
351 |
| -#endif // ARDUINO_ARCH_AVR |
| 333 | +#if !defined(SPI_HAS_EXTENDED_CS_PIN_HANDLING) |
| 334 | + #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) |
| 335 | + inline static void initSS() { DDRB |= _BV(4); }; |
| 336 | + inline static void setSS() { PORTB &= ~_BV(4); }; |
| 337 | + inline static void resetSS() { PORTB |= _BV(4); }; |
| 338 | + #elif defined(__AVR_ATmega32U4__) |
| 339 | + inline static void initSS() { DDRB |= _BV(6); }; |
| 340 | + inline static void setSS() { PORTB &= ~_BV(6); }; |
| 341 | + inline static void resetSS() { PORTB |= _BV(6); }; |
| 342 | + #elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB162__) |
| 343 | + inline static void initSS() { DDRB |= _BV(0); }; |
| 344 | + inline static void setSS() { PORTB &= ~_BV(0); }; |
| 345 | + inline static void resetSS() { PORTB |= _BV(0); }; |
| 346 | + #else |
| 347 | + inline static void initSS() { DDRB |= _BV(2); }; |
| 348 | + inline static void setSS() { PORTB &= ~_BV(2); }; |
| 349 | + inline static void resetSS() { PORTB |= _BV(2); }; |
| 350 | + #endif |
| 351 | +#endif // !SPI_HAS_EXTENDED_CS_PIN_HANDLING |
352 | 352 | };
|
353 | 353 |
|
354 | 354 | extern W5100Class W5100;
|
|
0 commit comments