Skip to content

Commit 2a5c92b

Browse files
committed
save another 26 bytes of flash by using uint8_t instead of uint16_t for 8-bit enc28j60 register
1 parent 6aed921 commit 2a5c92b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utility/Enc28J60Network.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void Enc28J60Network::init(uint8_t* macaddr)
148148
memhandle
149149
Enc28J60Network::receivePacket()
150150
{
151-
uint16_t rxstat;
151+
uint8_t rxstat;
152152
uint16_t len;
153153
// check if a packet has been received and buffered
154154
//if( !(readReg(EIR) & EIR_PKTIF) ){
@@ -167,7 +167,7 @@ Enc28J60Network::receivePacket()
167167
len -= 4; //remove the CRC count
168168
// read the receive status (see datasheet page 43)
169169
rxstat = readOp(ENC28J60_READ_BUF_MEM, 0);
170-
rxstat |= readOp(ENC28J60_READ_BUF_MEM, 0) << 8;
170+
//rxstat |= readOp(ENC28J60_READ_BUF_MEM, 0) << 8;
171171
// decrement the packet counter indicate we are done with this packet
172172
writeOp(ENC28J60_BIT_FIELD_SET, ECON2, ECON2_PKTDEC);
173173
// check CRC and symbol errors (see datasheet page 44, table 7-3):

0 commit comments

Comments
 (0)