src/eric7/MicroPython/Devices/RP2Devices.py

branch
eric7
changeset 11240
c48c615c04a3
parent 11237
c1c31b861d54
diff -r dff8babf4707 -r c48c615c04a3 src/eric7/MicroPython/Devices/RP2Devices.py
--- a/src/eric7/MicroPython/Devices/RP2Devices.py	Sat Apr 26 12:00:21 2025 +0200
+++ b/src/eric7/MicroPython/Devices/RP2Devices.py	Sat Apr 26 12:34:32 2025 +0200
@@ -513,7 +513,28 @@
         # picowireless:
         # It seems to take up to 20 sec to detect, that no Pico Wireless Pack is
         # attached. Therefore the command will timeout before.
-        command = """
+        if Preferences.getMicroPython("DisablePicowireless"):
+            # Support for Pimoroni Pico Wireless Pack is disabled.
+            command = """
+def has_wifi():
+    try:
+        import network
+        if hasattr(network, 'WLAN'):
+            wifi = network.WLAN(network.STA_IF)
+            if not wifi.active():
+                wifi.active(True)
+                wifi.active(False)
+            return True, 'picow'
+    except ImportError:
+        pass
+
+    return False, ''
+
+print(has_wifi())
+del has_wifi
+"""
+        else:
+            command = """
 def has_wifi():
     try:
         import network

eric ide

mercurial