diff --git a/MicroPython_BUILD/components/micropython/esp32/modules/inisetup.py b/MicroPython_BUILD/components/micropython/esp32/modules/inisetup.py index 7205297..d672580 100644 --- a/MicroPython_BUILD/components/micropython/esp32/modules/inisetup.py +++ b/MicroPython_BUILD/components/micropython/esp32/modules/inisetup.py @@ -1,7 +1,7 @@ -import uos, time, machine +import os, time, machine def setup(): - uos.chdir('/flash') + os.chdir('/flash') with open("boot.py", "w") as f: f.write("""\ # This file is executed on every boot (including wake-boot from deepsleep) diff --git a/MicroPython_BUILD/components/micropython/esp32/modules/m5stack.py b/MicroPython_BUILD/components/micropython/esp32/modules/m5stack.py index 72365d7..22dbac4 100644 --- a/MicroPython_BUILD/components/micropython/esp32/modules/m5stack.py +++ b/MicroPython_BUILD/components/micropython/esp32/modules/m5stack.py @@ -1,8 +1,5 @@ from micropython import const -import uos as os -import machine, ubinascii -import utime as time -from utime import ticks_ms +import os, time, machine, ubinascii import display as lcd import utils @@ -37,9 +34,9 @@ class Button: if self._pin == pin: # FALLING if pin_val == 0: - if ticks_ms() - self._timeshoot > self._dbtime: + if time.ticks_ms() - self._timeshoot > self._dbtime: self._lastState = True - self._startTicks = ticks_ms() + self._startTicks = time.ticks_ms() self._event |= 0x02 # EVENT_WAS_PRESSED if self._wasPressed_cb: self._wasPressed_cb() @@ -51,11 +48,11 @@ class Button: if self._wasReleased_cb: self._wasReleased_cb() if self._timeout > 0: - if ticks_ms() - self._startTicks > self._timeout: + if time.ticks_ms() - self._startTicks > self._timeout: self._event |= 0x08 # EVENT_RELEASED_FOR if self._releasedFor_cb: self._releasedFor_cb() - self._timeshoot = ticks_ms() + self._timeshoot = time.ticks_ms() def read(self): @@ -93,7 +90,7 @@ class Button: def pressedFor(self, timeout): - if self._lastState and ticks_ms() - self._startTicks > timeout * 1000: + if self._lastState and time.ticks_ms() - self._startTicks > timeout * 1000: return True else: return False diff --git a/MicroPython_BUILD/components/micropython/esp32/modules/wificonfig.py b/MicroPython_BUILD/components/micropython/esp32/modules/wificonfig.py index 8cdbee1..15cd2a5 100644 --- a/MicroPython_BUILD/components/micropython/esp32/modules/wificonfig.py +++ b/MicroPython_BUILD/components/micropython/esp32/modules/wificonfig.py @@ -122,6 +122,7 @@ routeHandlers = [ def webserver_start(): wlan_ap = network.WLAN(network.AP_IF) + wlan_ap.active(False) wlan_ap.active(True) node_id = ubinascii.hexlify(machine.unique_id()) ssid_name= "M5Stack-"+node_id[-6:].decode('utf-8')