Skip to content

Commit 35a8cbb

Browse files
committed
Mask address written to socket to prevent rollover issues
1 parent d50fe38 commit 35a8cbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_wiznet5k/adafruit_wiznet5k.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ def _read_snrx_rd(self, sock):
802802
return self._pbuff[0] << 8 | self._pbuff[1]
803803

804804
def _write_snrx_rd(self, sock, data):
805-
self._write_socket(sock, REG_SNRX_RD, data >> 8)
805+
self._write_socket(sock, REG_SNRX_RD, data >> 8 & 0xFF)
806806
self._write_socket(sock, REG_SNRX_RD + 1, data & 0xFF)
807807

808808
def _write_sntx_wr(self, sock, data):
809-
self._write_socket(sock, REG_SNTX_WR, data >> 8)
809+
self._write_socket(sock, REG_SNTX_WR, data >> 8 & 0xFF)
810810
self._write_socket(sock, REG_SNTX_WR + 1, data & 0xFF)
811811

812812
def _read_sntx_wr(self, sock):

0 commit comments

Comments
 (0)