Fixups for wiznet 5500 driver

This commit is contained in:
Nick Moore 2018-10-04 21:17:51 +10:00
parent 38d99b11c1
commit 8670215ecc
3 changed files with 10 additions and 3 deletions

View File

@ -286,7 +286,7 @@ int32_t WIZCHIP_EXPORT(send)(uint8_t sn, uint8_t * buf, uint16_t len)
if(tmp & Sn_IR_SENDOK)
{
setSn_IR(sn, Sn_IR_SENDOK);
#if _WZICHIP_ == 5200
#if _WIZCHIP_ == 5200
if(getSn_TX_RD(sn) != sock_next_rd[sn])
{
setSn_CR(sn,Sn_CR_SEND);
@ -525,6 +525,7 @@ int32_t WIZCHIP_EXPORT(recvfrom)(uint8_t sn, uint8_t * buf, uint16_t len, uint8_
// read peer's IP address, port number & packet length
sock_remained_size[sn] = head[0];
sock_remained_size[sn] = (sock_remained_size[sn] <<8) + head[1];
sock_remained_size[sn] -= 2; // len includes 2 len bytes
if(sock_remained_size[sn] > 1514)
{
WIZCHIP_EXPORT(close)(sn);

View File

@ -130,7 +130,7 @@
*/
#define _WIZCHIP_IO_BASE_ 0x00000000 //
#if _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS
#if _WIZCHIP_IO_MODE_ & _WIZCHIP_IO_MODE_BUS_
#ifndef _WIZCHIP_IO_BASE_
#error "You should be define _WIZCHIP_IO_BASE to fit your system memory map."
#endif

View File

@ -15,6 +15,7 @@
//! 3. Remove the unused define
//! 4. Integrated dns.h dns.c & dns_parse.h dns_parse.c into dns.h & dns.c
//! <2013/12/20> V1.1.0
//! <2018/10/04> Modified HAL_GetTick for use with CircuitPython by Nick Moore
//!
//! \author Eric Jung & MidnightCow
//! \copyright
@ -51,6 +52,7 @@
#include <string.h>
#include <stdlib.h>
#include "tick.h"
//#include "Ethernet/socket.h"
//#include "Internet/DNS/dns.h"
@ -121,7 +123,11 @@ uint8_t* pDNSMSG; // DNS message buffer
uint8_t DNS_SOCKET; // SOCKET number for DNS
uint16_t DNS_MSGID; // DNS message ID
extern uint32_t HAL_GetTick(void);
uint32_t HAL_GetTick(void) {
return ticks_ms;
}
uint32_t hal_sys_tick;
/* converts uint16_t from network buffer to a host byte order integer. */