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

Commit 63f2ae4

Browse files
committed
v0.3.9
1 parent 01ee38d commit 63f2ae4

3 files changed

Lines changed: 1175 additions & 15 deletions

File tree

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ backup.sh
5555

5656
MicroPython_BUILD/components/micropython/esp32/modules/mtftp.py
5757
MicroPython_BUILD/components/micropython/esp32/modules/m5cloud.py
58-
<<<<<<< HEAD
59-
=======
60-
MicroPython_BUILD/components/internalfs_image/image-dev
61-
# MicroPython_BUILD/components/micropython/extmod/vfs_native.c
58+
MicroPython_BUILD/components/internalfs_image
6259
MicroPython_BUILD/firmware
6360
.vscode/
64-
>>>>>>> m5stack-dev

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import display as lcd
77
import utils
88

9-
VERSION = "v0.3.8"
9+
VERSION = "v0.3.9"
1010

1111
_BUTTON_A_PIN = const(39)
1212
_BUTTON_B_PIN = const(38)
@@ -20,7 +20,7 @@ def __init__(self, pin, dbtime=50):
2020
from machine import Pin
2121
self._pin = Pin(pin)
2222
self._pin.init(Pin.IN)
23-
self._pin.irq(trigger=(Pin.IRQ_FALLING|Pin.IRQ_RISING), handler=self.irq_cb)
23+
self._pin.irq(self.irq_cb, (Pin.IRQ_FALLING|Pin.IRQ_RISING))
2424
self._wasPressed_cb = None
2525
self._wasReleased_cb = None
2626
self._releasedFor_cb = None
@@ -111,7 +111,6 @@ def releasedFor(self, timeout, callback=None):
111111
self._releasedFor_cb = callback
112112

113113

114-
115114
class Speaker:
116115
def __init__(self, pin=25, volume=2):
117116
self.pwm = machine.PWM(machine.Pin(pin), 1, 0, 0)
@@ -133,14 +132,13 @@ def volume(self, val):
133132
self._volume = val * 10
134133

135134

136-
#
137-
def fimage(x, y, file):
135+
def fimage(x, y, file, type=1):
138136
if file[:3] == '/sd':
139-
utils.filecp(file, '/flash/fcache', blocksize=4096)
140-
lcd.image(x, y, '/flash/fcache', 0, lcd.JPG)
137+
utils.filecp(file, '/flash/fcache', blocksize=8192)
138+
lcd.image(x, y, '/flash/fcache', 0, type)
141139
os.remove('/flash/fcache')
142140
else:
143-
lcd.image(x, y, file, 0, lcd.JPG)
141+
lcd.image(x, y, file, 0, type)
144142

145143

146144
def delay(ms):
@@ -156,9 +154,9 @@ def delay(ms):
156154

157155
# LCD
158156
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)
157+
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)
160158
lcd.clear()
161-
lcd.setBrightness(600)
159+
lcd.setBrightness(500)
162160
lcd.setColor(0xCCCCCC)
163161
lcd.println('M5Stack MicroPython '+VERSION, 0, 0)
164162
lcd.println('Device ID:'+node_id)

0 commit comments

Comments
 (0)