Skip to content

Commit 2c3af9c

Browse files
committed
Force BANK bit to 0 via suggested method.
1 parent e5d86da commit 2c3af9c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

adafruit_mcp230xx/mcp23017.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ def io_control(self):
259259

260260
@io_control.setter
261261
def io_control(self, val):
262-
val |= 0b000001
263-
val ^= 0b000001
262+
val &= ~0x80
264263
self._write_u8(_MCP23017_IOCON, val)
265264

266265
@property

adafruit_mcp230xx/mcp23s17.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,7 @@ def io_control(self):
263263

264264
@io_control.setter
265265
def io_control(self, val):
266-
val |= 0b000001
267-
val ^= 0b000001
266+
val &= ~0x80
268267
self._write_u8(_MCP23S17_IOCON, val)
269268

270269
@property

0 commit comments

Comments
 (0)