Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

Commit 2d52586

Browse files
committed
Modify ethernet chip version check function
1 parent 60e4fbd commit 2d52586

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

libraries/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ add_library(ETHERNET_FILES STATIC)
33

44
target_sources(ETHERNET_FILES PUBLIC
55
${WIZNET_DIR}/Ethernet/socket.c
6-
${WIZNET_DIR}/Ethernet/wizchip_conf.c
6+
${WIZNET_DIR}/Ethernet/wizchip_conf.c
77
)
88

99
target_include_directories(ETHERNET_FILES INTERFACE
@@ -198,7 +198,7 @@ target_sources(MQTT_FILES PUBLIC
198198
target_include_directories(MQTT_FILES PUBLIC
199199
${WIZNET_DIR}/Ethernet
200200
${WIZNET_DIR}/Internet/MQTT
201-
${WIZNET_DIR}/Internet/MQTTPacket/src
201+
${WIZNET_DIR}/Internet/MQTTPacket/src
202202
)
203203

204204
# SNTP

port/ioLibrary_Driver/w5x00_spi.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,25 @@ void wizchip_initialize(void)
217217

218218
void wizchip_check(void)
219219
{
220+
#if (_WIZCHIP_ == W5100S)
220221
/* Read version register */
221-
if (getVER() != 0x51) // W5100S
222+
if (getVER() != 0x51)
222223
{
223-
printf(" ACCESS ERR : VERSIONR != 0x51, read value = 0x%02x\n", getVER());
224+
printf(" ACCESS ERR : VERSION != 0x51, read value = 0x%02x\n", getVER());
224225

225226
while (1)
226227
;
227228
}
229+
#elif (_WIZCHIP_ == W5500)
230+
/* Read version register */
231+
if (getVERSIONR() != 0x04)
232+
{
233+
printf(" ACCESS ERR : VERSION != 0x04, read value = 0x%02x\n", getVERSIONR());
234+
235+
while (1)
236+
;
237+
}
238+
#endif
228239
}
229240

230241
/* Network */

0 commit comments

Comments
 (0)