File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
libraries/Ethernet/src/utility Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ W5x00Class W5100;
17
17
18
18
uint8_t W5x00Class::chipset = W5x00Chipset::W5100;
19
19
uint8_t W5x00Class::sockets = 4 ;
20
+ uint16_t W5x00Class::CH_BASE = 0 ;
20
21
21
22
#define TX_RX_MAX_BUF_SIZE 2048
22
23
#define TX_BUF 0x1100
@@ -79,6 +80,7 @@ void W5x00Class::init(void)
79
80
// The default size for the RX and TX buffers is 2 kB
80
81
if (chipset == W5x00Chipset::W5100) {
81
82
sockets = 4 ;
83
+ CH_BASE = 0x0400 ;
82
84
SPI.beginTransaction (SPI_ETHERNET_SETTINGS);
83
85
writeMR (1 <<RST);
84
86
SPI.endTransaction ();
@@ -91,6 +93,7 @@ void W5x00Class::init(void)
91
93
}
92
94
} else if (chipset == W5x00Chipset::W5200) {
93
95
sockets = 8 ;
96
+ CH_BASE = 0x4000 ;
94
97
SPI.beginTransaction (SPI_ETHERNET_SETTINGS);
95
98
writeMR (1 <<RST);
96
99
SPI.endTransaction ();
@@ -101,8 +104,9 @@ void W5x00Class::init(void)
101
104
SBASE[i] = TXBUF_BASE + SSIZE * i;
102
105
RBASE[i] = RXBUF_BASE + RSIZE * i;
103
106
}
104
- } else {
107
+ } else { // W5500
105
108
sockets = 8 ;
109
+ CH_BASE = 0x0400 ;
106
110
SPI.beginTransaction (SPI_ETHERNET_SETTINGS);
107
111
writeMR (1 <<RST);
108
112
SPI.endTransaction ();
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ class W5x00Class {
276
276
static inline uint16_t readSn (SOCKET _s, uint16_t _addr, uint8_t *_buf, uint16_t len);
277
277
static inline uint16_t writeSn (SOCKET _s, uint16_t _addr, uint8_t *_buf, uint16_t len);
278
278
279
- static const uint16_t CH_BASE = 0x0400 ;
279
+ static uint16_t CH_BASE;
280
280
static const uint16_t CH_SIZE = 0x0100 ;
281
281
282
282
#define __SOCKET_REGISTER8 (name, address ) \
You can’t perform that action at this time.
0 commit comments