MicroPython: added (preliminary) support for micro:bit V2.

Wed, 10 Feb 2021 15:42:56 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 10 Feb 2021 15:42:56 +0100
changeset 8091
c000526a6d0d
parent 8090
c53117374255
child 8092
c0d72dbba8bb

MicroPython: added (preliminary) support for micro:bit V2.

eric6/MicroPython/MicrobitDevices.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/MicroPythonPage.py file | annotate | diff | comparison | revisions
eric6/Preferences/ConfigurationPages/MicroPythonPage.ui file | annotate | diff | comparison | revisions
eric6/Preferences/__init__.py file | annotate | diff | comparison | revisions
--- a/eric6/MicroPython/MicrobitDevices.py	Tue Feb 09 17:51:16 2021 +0100
+++ b/eric6/MicroPython/MicrobitDevices.py	Wed Feb 10 15:42:56 2021 +0100
@@ -394,8 +394,10 @@
         """
         if self.__deviceType == "bbc_microbit":
             return [
-                (self.tr("MicroPython Firmware"),
+                (self.tr("MicroPython Firmware for BBC micro:bit V1"),
                  Preferences.getMicroPython("MicrobitMicroPythonUrl")),
+                (self.tr("MicroPython Firmware for BBC micro:bit V2"),
+                 Preferences.getMicroPython("MicrobitV2MicroPythonUrl")),
                 (self.tr("DAPLink Firmware"),
                  Preferences.getMicroPython("MicrobitFirmwareUrl"))
             ]
--- a/eric6/Preferences/ConfigurationPages/MicroPythonPage.py	Tue Feb 09 17:51:16 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/MicroPythonPage.py	Wed Feb 10 15:42:56 2021 +0100
@@ -118,12 +118,13 @@
         self.circuitpythonDocuUrlLineEdit.setText(
             Preferences.getMicroPython("CircuitPythonDocuUrl"))
         
-        # TODO: add entry for micro:bit v2 URLs
         # BBC micro:bit URLs
         self.microbitFirmwareUrlLineEdit.setText(
             Preferences.getMicroPython("MicrobitFirmwareUrl"))
-        self.microbitMicroPythonUrlLineEdit.setText(
+        self.microbitV1MicroPythonUrlLineEdit.setText(
             Preferences.getMicroPython("MicrobitMicroPythonUrl"))
+        self.microbitV2MicroPythonUrlLineEdit.setText(
+            Preferences.getMicroPython("MicrobitV2MicroPythonUrl"))
         self.microbitDocuUrlLineEdit.setText(
             Preferences.getMicroPython("MicrobitDocuUrl"))
         
@@ -195,14 +196,16 @@
             "CircuitPythonDocuUrl",
             self.circuitpythonDocuUrlLineEdit.text())
         
-        # TODO: add entry for micro:bit v2 URLs
         # BBC micro:bit URLs
         Preferences.setMicroPython(
             "MicrobitFirmwareUrl",
             self.microbitFirmwareUrlLineEdit.text())
         Preferences.setMicroPython(
             "MicrobitMicroPythonUrl",
-            self.microbitMicroPythonUrlLineEdit.text())
+            self.microbitV1MicroPythonUrlLineEdit.text())
+        Preferences.setMicroPython(
+            "MicrobitV2MicroPythonUrl",
+            self.microbitV2MicroPythonUrlLineEdit.text())
         Preferences.setMicroPython(
             "MicrobitDocuUrl",
             self.microbitDocuUrlLineEdit.text())
--- a/eric6/Preferences/ConfigurationPages/MicroPythonPage.ui	Tue Feb 09 17:51:16 2021 +0100
+++ b/eric6/Preferences/ConfigurationPages/MicroPythonPage.ui	Wed Feb 10 15:42:56 2021 +0100
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>476</width>
-    <height>1087</height>
+    <height>1205</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout">
@@ -348,7 +348,7 @@
      <property name="title">
       <string>BBC micro:bit</string>
      </property>
-     <layout class="QGridLayout" name="gridLayout_3">
+     <layout class="QGridLayout" name="gridLayout_7">
       <item row="0" column="0">
        <widget class="QLabel" name="label_18">
         <property name="text">
@@ -363,18 +363,41 @@
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
-       <widget class="QLabel" name="label_4">
-        <property name="text">
-         <string>MicroPython:</string>
+      <item row="1" column="0" colspan="2">
+       <widget class="QGroupBox" name="groupBox_6">
+        <property name="title">
+         <string>MicroPython</string>
         </property>
-       </widget>
-      </item>
-      <item row="1" column="1">
-       <widget class="E5ClearableLineEdit" name="microbitMicroPythonUrlLineEdit">
-        <property name="toolTip">
-         <string>Enter the URL for the BBC micro:bit MicroPython Firmware</string>
-        </property>
+        <layout class="QGridLayout" name="gridLayout_3">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>micro:bit V1:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="E5ClearableLineEdit" name="microbitV1MicroPythonUrlLineEdit">
+           <property name="toolTip">
+            <string>Enter the URL for the BBC micro:bit V1 MicroPython Firmware</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="text">
+            <string>micro:bit V2:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="E5ClearableLineEdit" name="microbitV2MicroPythonUrlLineEdit">
+           <property name="toolTip">
+            <string>Enter the URL for the BBC micro:bit V2 MicroPython Firmware</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
        </widget>
       </item>
       <item row="2" column="0">
@@ -488,7 +511,8 @@
   <tabstop>circuitpythonLibrariesUrlLineEdit</tabstop>
   <tabstop>circuitpythonDocuUrlLineEdit</tabstop>
   <tabstop>microbitFirmwareUrlLineEdit</tabstop>
-  <tabstop>microbitMicroPythonUrlLineEdit</tabstop>
+  <tabstop>microbitV1MicroPythonUrlLineEdit</tabstop>
+  <tabstop>microbitV2MicroPythonUrlLineEdit</tabstop>
   <tabstop>microbitDocuUrlLineEdit</tabstop>
   <tabstop>calliopeFirmwareUrlLineEdit</tabstop>
   <tabstop>calliopeMicroPythonUrlLineEdit</tabstop>
--- a/eric6/Preferences/__init__.py	Tue Feb 09 17:51:16 2021 +0100
+++ b/eric6/Preferences/__init__.py	Wed Feb 10 15:42:56 2021 +0100
@@ -1468,6 +1468,9 @@
             "https://microbit.org/guide/firmware/",
         "MicrobitMicroPythonUrl":
             "https://github.com/bbcmicrobit/micropython/releases/",
+        "MicrobitV2MicroPythonUrl":
+            "https://github.com/microbit-foundation/micropython-microbit-v2/"
+            "releases/",
         
         # calliope mini URLS
         "CalliopeDocuUrl":

eric ide

mercurial