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

Commit

Permalink
Modify ethernet chip version check function
Browse files Browse the repository at this point in the history
  • Loading branch information
Giung951 committed Jan 19, 2022
1 parent 60e4fbd commit 2d52586
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ add_library(ETHERNET_FILES STATIC)

target_sources(ETHERNET_FILES PUBLIC
${WIZNET_DIR}/Ethernet/socket.c
${WIZNET_DIR}/Ethernet/wizchip_conf.c
${WIZNET_DIR}/Ethernet/wizchip_conf.c
)

target_include_directories(ETHERNET_FILES INTERFACE
Expand Down Expand Up @@ -198,7 +198,7 @@ target_sources(MQTT_FILES PUBLIC
target_include_directories(MQTT_FILES PUBLIC
${WIZNET_DIR}/Ethernet
${WIZNET_DIR}/Internet/MQTT
${WIZNET_DIR}/Internet/MQTTPacket/src
${WIZNET_DIR}/Internet/MQTTPacket/src
)

# SNTP
Expand Down
15 changes: 13 additions & 2 deletions port/ioLibrary_Driver/w5x00_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,25 @@ void wizchip_initialize(void)

void wizchip_check(void)
{
#if (_WIZCHIP_ == W5100S)
/* Read version register */
if (getVER() != 0x51) // W5100S
if (getVER() != 0x51)
{
printf(" ACCESS ERR : VERSIONR != 0x51, read value = 0x%02x\n", getVER());
printf(" ACCESS ERR : VERSION != 0x51, read value = 0x%02x\n", getVER());

while (1)
;
}
#elif (_WIZCHIP_ == W5500)
/* Read version register */
if (getVERSIONR() != 0x04)
{
printf(" ACCESS ERR : VERSION != 0x04, read value = 0x%02x\n", getVERSIONR());

while (1)
;
}
#endif
}

/* Network */
Expand Down

0 comments on commit 2d52586

Please sign in to comment.