Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Commit 9c12e7d

Browse files
committed
v0.3.9
1 parent 1e7773c commit 9c12e7d

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

MicroPython_BUILD/components/micropython/esp32/modules/inisetup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import uos, time, machine
1+
import os, time, machine
22

33
def setup():
4-
uos.chdir('/flash')
4+
os.chdir('/flash')
55
with open("boot.py", "w") as f:
66
f.write("""\
77
# This file is executed on every boot (including wake-boot from deepsleep)

MicroPython_BUILD/components/micropython/esp32/modules/m5stack.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
from micropython import const
2-
import uos as os
3-
import machine, ubinascii
4-
import utime as time
5-
from utime import ticks_ms
2+
import os, time, machine, ubinascii
63
import display as lcd
74
import utils
85

9-
VERSION = "v0.3.8"
6+
VERSION = "v0.3.9"
107

118
_BUTTON_A_PIN = const(39)
129
_BUTTON_B_PIN = const(38)
@@ -37,9 +34,9 @@ def irq_cb(self, pin):
3734
if self._pin == pin:
3835
# FALLING
3936
if pin_val == 0:
40-
if ticks_ms() - self._timeshoot > self._dbtime:
37+
if time.ticks_ms() - self._timeshoot > self._dbtime:
4138
self._lastState = True
42-
self._startTicks = ticks_ms()
39+
self._startTicks = time.ticks_ms()
4340
self._event |= 0x02 # EVENT_WAS_PRESSED
4441
if self._wasPressed_cb:
4542
self._wasPressed_cb()
@@ -51,11 +48,11 @@ def irq_cb(self, pin):
5148
if self._wasReleased_cb:
5249
self._wasReleased_cb()
5350
if self._timeout > 0:
54-
if ticks_ms() - self._startTicks > self._timeout:
51+
if time.ticks_ms() - self._startTicks > self._timeout:
5552
self._event |= 0x08 # EVENT_RELEASED_FOR
5653
if self._releasedFor_cb:
5754
self._releasedFor_cb()
58-
self._timeshoot = ticks_ms()
55+
self._timeshoot = time.ticks_ms()
5956

6057

6158
def read(self):
@@ -93,7 +90,7 @@ def wasReleased(self, callback=None):
9390

9491

9592
def pressedFor(self, timeout):
96-
if self._lastState and ticks_ms() - self._startTicks > timeout * 1000:
93+
if self._lastState and time.ticks_ms() - self._startTicks > timeout * 1000:
9794
return True
9895
else:
9996
return False
@@ -156,9 +153,9 @@ def delay(ms):
156153

157154
# LCD
158155
lcd = lcd.TFT()
159-
lcd.init(lcd.M5STACK, width=240, height=320, rst_pin=33, backl_pin=32, miso=19, mosi=23, clk=18, cs=14, dc=27, bgr=True, backl_on=1, invrot=3)
156+
lcd.init(lcd.M5STACK, width=240, height=320, speed=27000000, rst_pin=33, backl_pin=32, miso=19, mosi=23, clk=18, cs=14, dc=27, bgr=True, backl_on=1, invrot=3)
160157
lcd.clear()
161-
lcd.setBrightness(600)
158+
lcd.setBrightness(500)
162159
lcd.setColor(0xCCCCCC)
163160
lcd.println('M5Stack MicroPython '+VERSION, 0, 0)
164161
lcd.println('Device ID:'+node_id)

MicroPython_BUILD/components/micropython/esp32/modules/wificonfig.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def _httpHanderConfig(httpClient, httpResponse) :
122122

123123
def webserver_start():
124124
wlan_ap = network.WLAN(network.AP_IF)
125+
wlan_ap.active(False)
125126
wlan_ap.active(True)
126127
node_id = ubinascii.hexlify(machine.unique_id())
127128
ssid_name= "M5Stack-"+node_id[-6:].decode('utf-8')

0 commit comments

Comments
 (0)