From 0446055537fe8147abe399110325587c6db3b727 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Sat, 7 Nov 2020 21:14:04 +0100 Subject: [PATCH] define to use W5500 chip and mark SPI functions to be replaced as weak --- Ethernet/wizchip_conf.c | 12 ++++++------ Ethernet/wizchip_conf.h | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Ethernet/wizchip_conf.c b/Ethernet/wizchip_conf.c index f6497ba..68104c6 100644 --- a/Ethernet/wizchip_conf.c +++ b/Ethernet/wizchip_conf.c @@ -80,7 +80,7 @@ void wizchip_cris_exit(void) {} * null function is called. */ //void wizchip_cs_select(void) {}; -void wizchip_cs_select(void) {} +__attribute__((weak)) void wizchip_cs_select(void) {} /** * @brief Default function to deselect chip. @@ -88,7 +88,7 @@ void wizchip_cs_select(void) {} * null function is called. */ //void wizchip_cs_deselect(void) {}; -void wizchip_cs_deselect(void) {} +__attribute__((weak)) void wizchip_cs_deselect(void) {} /** * @brief Default function to read in direct or indirect interface. @@ -114,7 +114,7 @@ void wizchip_bus_writedata(uint32_t AddrSel, iodata_t wb) { *((volatile iodata * null function is called. */ //uint8_t wizchip_spi_readbyte(void) {return 0;}; -uint8_t wizchip_spi_readbyte(void) {return 0;} +__attribute__((weak)) uint8_t wizchip_spi_readbyte(void) {return 0;} /** * @brief Default function to write in SPI interface. @@ -122,7 +122,7 @@ uint8_t wizchip_spi_readbyte(void) {return 0;} * null function is called. */ //void wizchip_spi_writebyte(uint8_t wb) {}; -void wizchip_spi_writebyte(uint8_t wb) {} +__attribute__((weak)) void wizchip_spi_writebyte(uint8_t wb) {} /** * @brief Default function to burst read in SPI interface. @@ -130,7 +130,7 @@ void wizchip_spi_writebyte(uint8_t wb) {} * null function is called. */ //void wizchip_spi_readburst(uint8_t* pBuf, uint16_t len) {}; -void wizchip_spi_readburst(uint8_t* pBuf, uint16_t len) {} +__attribute__((weak)) void wizchip_spi_readburst(uint8_t* pBuf, uint16_t len) {} /** * @brief Default function to burst write in SPI interface. @@ -138,7 +138,7 @@ void wizchip_spi_readburst(uint8_t* pBuf, uint16_t len) {} * null function is called. */ //void wizchip_spi_writeburst(uint8_t* pBuf, uint16_t len) {}; -void wizchip_spi_writeburst(uint8_t* pBuf, uint16_t len) {} +__attribute__((weak)) void wizchip_spi_writeburst(uint8_t* pBuf, uint16_t len) {} /** * @\ref _WIZCHIP instance diff --git a/Ethernet/wizchip_conf.h b/Ethernet/wizchip_conf.h index 33958a8..11bdd4f 100644 --- a/Ethernet/wizchip_conf.h +++ b/Ethernet/wizchip_conf.h @@ -71,6 +71,10 @@ extern "C" { #define W5300 5300 #define W5500 5500 + +#define _WIZCHIP_ W5500 + + #ifndef _WIZCHIP_ #define _WIZCHIP_ W5100S // W5100, W5100S, W5200, W5300, W5500 #endif