Skip to content

Commit 3a5c17d

Browse files
committed
Only output chip IDs if debug is set to True
1 parent fbb1429 commit 3a5c17d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

adafruit_focaltouch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ def __init__(self, i2c, address=_FT_DEFAULT_I2C_ADDR, debug=False, irq_pin=None)
8484
lib_ver, chip_id, _, _, firm_id, _, vend_id = struct.unpack(
8585
">HBBBBBB", chip_data
8686
)
87-
print(
88-
"lib_ver: {:02X}, chip_id: {:02X}, firm_id: {:02X}, vend_id: {:02X}".format(
89-
lib_ver, chip_id, firm_id, vend_id
87+
if debug:
88+
print(
89+
"lib_ver: {:02X}, chip_id: {:02X}, firm_id: {:02X}, vend_id: {:02X}".format(
90+
lib_ver, chip_id, firm_id, vend_id
91+
)
9092
)
91-
)
9293

9394
if vend_id not in (0x11, 0x42, 0x01):
9495
raise RuntimeError("Did not find FT chip")

0 commit comments

Comments
 (0)