MicroPythonCommandsInterface: modified syncTime() slightly to work with LoBo port of MicroPython.

Wed, 04 Sep 2019 20:01:53 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 04 Sep 2019 20:01:53 +0200
changeset 7208
d30ac02a5f04
parent 7205
f1ee707adc0b
child 7210
8fe313d039e6

MicroPythonCommandsInterface: modified syncTime() slightly to work with LoBo port of MicroPython.

eric6/MicroPython/MicroPythonCommandsInterface.py file | annotate | diff | comparison | revisions
--- a/eric6/MicroPython/MicroPythonCommandsInterface.py	Mon Sep 02 19:29:26 2019 +0200
+++ b/eric6/MicroPython/MicroPythonCommandsInterface.py	Wed Sep 04 20:01:53 2019 +0200
@@ -773,7 +773,11 @@
                 " (rtc_time[6],) + rtc_time[3:6] + (0,)",
                 "                rtc.datetime(clock_time)",
                 "            except Exception:",  # ESP32 uses rtc.init()
-                "                clock_time = rtc_time[:3] +"
+                "                import os",
+                "                if 'LoBo' in os.uname()[0]:",  # LoBo MPy
+                "                    clock_time = rtc_time + (0,)",
+                "                else:",
+                "                    clock_time = rtc_time[:3] +"
                 " (rtc_time[6],) + rtc_time[3:6] + (0,)",
                 "                rtc.init(clock_time)",
                 "            del __machine_",

eric ide

mercurial