Skip to content

Commit 394fe4f

Browse files
committed
Update write function to suppress debug messages.
I don't think the write function is actually used for anything, but as long as I am updating stuff anyway, suppress a debug print unless 'debug' is set to True.
1 parent 3a5c17d commit 394fe4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_focaltouch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ def _write(self, register, values) -> None:
167167
"""Writes an array of 'length' bytes to the 'register'"""
168168
with self._i2c as i2c:
169169
values = [(v & 0xFF) for v in [register] + values]
170-
print("register: %02X, value: %02X" % (values[0], values[1]))
170+
if self._debug:
171+
print("register: %02X, value: %02X" % (values[0], values[1]))
171172
i2c.write(bytes(values))
172173

173174
if self._debug:

0 commit comments

Comments
 (0)