Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Commit 8c3bdde

Browse files
author
mpratt14
authored
Allow basic support for libFTDI1.3
Between libFTDI versions 1.2 and 1.3. The largest difference is a simple syntax difference on one function, where they removed one of the three arguments. Simply try the one for <=1.2, and if that throws a TypeError, try the syntax for 1.3+ here is a screenshot: https://www.dropbox.com/s/m7a1ybx3ss2jotg/Screenshot%202019-03-11%2021.30.17.png?dl=0 This change is present in another commit, but with other changes. I am hoping that this simpler commit can be accepted easily... Signed-off-by: Michael Pratt <mpratt51@gmail.com>
1 parent 0528fe1 commit 8c3bdde

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Adafruit_GPIO/FT232H.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ def _write(self, string):
185185
#else:
186186
# logger.debug('Modem status error {0}'.format(ret))
187187
length = len(string)
188-
ret = ftdi.write_data(self._ctx, string, length)
188+
try:
189+
ret = ftdi.write_data(self._ctx, string, length)
190+
except TypeError:
191+
ret = ftdi.write_data(self._ctx, string); #compatible with libFtdi 1.3
189192
# Log the string that was written in a python hex string format using a very
190193
# ugly one-liner list comprehension for brevity.
191194
#logger.debug('Wrote {0}'.format(''.join(['\\x{0:02X}'.format(ord(x)) for x in string])))

0 commit comments

Comments
 (0)