Skip to content

Commit b8198d9

Browse files
committed
Merge branch 'master' of github.com:jamesbowman/i2cdriver
2 parents fda2bf8 + 8522964 commit b8198d9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python/samples/i2cgui.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import threading
77
from functools import partial
88

9+
import serial.tools.list_ports as slp
10+
911
import wx
1012
import wx.lib.newevent as NE
1113

@@ -242,7 +244,9 @@ def read(self, e):
242244
self.stop()
243245

244246
def devices(self):
245-
if sys.platform == 'darwin':
247+
if sys.platform == 'win32':
248+
return {pi.device: pi.device for pi in slp.comports()}
249+
elif sys.platform == 'darwin':
246250
devdir = "/dev/"
247251
pattern = "^cu.usbserial-(.*)"
248252
else:
@@ -312,7 +316,6 @@ def check_m(self, e):
312316
def set_speed(self, e):
313317
w = e.EventObject
314318
s = int(w.GetString(w.GetCurrentSelection()))
315-
print(s)
316319
self.sd.setspeed(s)
317320

318321
def hot(self, i, s):

0 commit comments

Comments
 (0)