@ -51,9 +51,9 @@
u08 Enc28j60Bank ;
u16 NextPacketPtr ;
void nicInit ( void )
char nicInit ( void )
{
enc28j60Init( ) ;
return enc28j60Init( ) ;
}
void nicSend ( unsigned int len , unsigned char * packet )
@ -90,7 +90,7 @@ void nicSetMacAddress(uint8_t* macaddr)
enc28j60Write ( MAADR0 , * macaddr + + ) ;
}
# if def NET_DEBUG || NIC_DEBUG
# if defined(NET_DEBUG) || defined(NIC_DEBUG)
void nicRegDump ( void )
{
enc28j60RegDump ( ) ;
@ -297,7 +297,7 @@ void enc28j60PhyWrite(uint8_t address, uint16_t data)
while ( enc28j60Read ( MISTAT ) & MISTAT_BUSY ) ;
}
void enc28j60Init ( void )
char enc28j60Init ( void )
{
/**
* Enable ENC28J560 Control ports
@ -346,18 +346,24 @@ void enc28j60Init(void)
SPrintln ( " PHY reboot done " ) ;
# endif
# ifdef ENC28J60_LAMPS_MODE
# ifdef ENC28J60_LAMPS_MODE
# ifdef DEBUG_ENC_INIT
SPrintln ( " Custom lamps " ) ;
# endif
enc28j60PhyWrite ( PHLCON , ENC28J60_LAMPS_MODE ) ;
# else
// Errata #9 correction
if ( enc28j60Read ( MACON3 ) & MACON3_FULDPX )
{
# ifdef DEBUG_ENC_INIT
SPrintln ( " Full duplex lamps " ) ;
# endif
enc28j60PhyWrite ( PHLCON , PHLCON_DEFAULT ) ;
} else {
# ifdef DEBUG_ENC_INIT
SPrintln ( " Half duplex lamps " ) ;
# endif
enc28j60PhyWrite ( PHLCON , PHLCON_DEFAULT_HD ) ;
}
# endif
@ -480,6 +486,7 @@ void enc28j60Init(void)
// setup duplex ----------------------
*/
return 0 ;
}
# define ETHERNET_MIN_PACKET_LENGTH 0x3C
@ -628,7 +635,7 @@ void enc28j60ReceiveOverflowRecover(void)
// recovery completed
}
# if def NET_DEBUG || NIC_DEBUG
# if defined(NET_DEBUG) || defined(NIC_DEBUG)
# define SPrint_D(str) SPrint(str); delayMicroseconds(100);
void enc28j60RegDump ( void )