src/eric7/MicroPython/MicroPythonDevices.py

branch
eric7
changeset 9738
4ae976ee5339
parent 9736
796b1ecab72c
child 9747
b7976868d5b0
diff -r 5e05b2089daf -r 4ae976ee5339 src/eric7/MicroPython/MicroPythonDevices.py
--- a/src/eric7/MicroPython/MicroPythonDevices.py	Thu Feb 02 13:42:50 2023 +0100
+++ b/src/eric7/MicroPython/MicroPythonDevices.py	Thu Feb 02 18:01:00 2023 +0100
@@ -423,7 +423,7 @@
         return EricPixmapCache.getPixmap(iconName)
 
 
-def getDevice(deviceType, microPythonWidget, vid, pid):
+def getDevice(deviceType, microPythonWidget, vid, pid, boardName=""):
     """
     Public method to instantiate a specific MicroPython device interface.
 
@@ -435,6 +435,8 @@
     @type int
     @param pid product ID (only used for deviceType 'generic')
     @type int
+    @param boardName name of the board (defaults to "")
+    @type str (optional)
     @return instantiated device interface
     @rtype MicroPythonDevice
     """
@@ -451,7 +453,7 @@
     with contextlib.suppress(KeyError):
         mod = importlib.import_module(deviceMapping[deviceType], __package__)
         if mod:
-            return mod.createDevice(microPythonWidget, deviceType, vid, pid)
+            return mod.createDevice(microPythonWidget, deviceType, vid, pid, boardName)
 
     # nothing specific requested or specific one failed or is not supported yet
     return MicroPythonDevice(microPythonWidget, deviceType)

eric ide

mercurial