UIPEthernet library for Arduino IDE, Eclipse with arduino plugin and MBED/SMeshStudio (AVR,STM32F,ESP8266,Intel ARC32,Nordic nRF51,Teensy boards,Realtek Ameba(RTL8195A,RTL8710)), ENC28j60 network chip. Compatible with Wiznet W5100 Ethernet library API. Compiled and tested on Nucleo-F302R8. Master repository is: https://github.com/UIPEthernet/UIPEthernet/
Diff: utility/Enc28J60Network.cpp
- Revision:
- 17:be34a75aa9a7
- Parent:
- 16:66225c1d660c
- Child:
- 19:e416943f7119
--- a/utility/Enc28J60Network.cpp Sun Jan 01 20:33:12 2017 +0100 +++ b/utility/Enc28J60Network.cpp Mon Jan 02 16:38:07 2017 +0100 @@ -370,14 +370,15 @@ #if ACTLOGLEVEL>=LOG_DEBUG_V3 LogObject.uart_send_strln(F("Enc28J60Network::setERXRDPT(void) DEBUG_V3:Function started")); #endif - nextPacketPtr == RXSTART_INIT ? RXSTOP_INIT : nextPacketPtr-1; - if (nextPacketPtr>RXSTOP_INIT) {nextPacketPtr=RXSTART_INIT;} - if ((nextPacketPtr&1)!=0) {nextPacketPtr--;} + uint16_t actnextPacketPtr; + nextPacketPtr == RXSTART_INIT ? actnextPacketPtr=RXSTOP_INIT : actnextPacketPtr=nextPacketPtr-1; + if (actnextPacketPtr>RXSTOP_INIT) {actnextPacketPtr=RXSTART_INIT;} + if ((actnextPacketPtr&1)!=0) {actnextPacketPtr--;} #if ACTLOGLEVEL>=LOG_DEBUG - LogObject.uart_send_str(F("Enc28J60Network::setERXRDPT(void) DEBUG:Set nextPacketPtr:")); - LogObject.uart_send_hexln(nextPacketPtr); + LogObject.uart_send_str(F("Enc28J60Network::setERXRDPT(void) DEBUG:Set actnextPacketPtr:")); + LogObject.uart_send_hexln(actnextPacketPtr); #endif - writeRegPair(ERXRDPTL, nextPacketPtr); + writeRegPair(ERXRDPTL, actnextPacketPtr); } memaddress