You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Fix poweroff button
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
- Settings: add Timezone configuration
|
||||
- Draw: new app for simple drawing on a canvas
|
||||
- IMU: new app for showing data from the Intertial Measurement Unit ("Accellerometer")
|
||||
- Speed up QR decoding 4x - thanks @kdmukai!
|
||||
|
||||
|
||||
0.0.8
|
||||
|
||||
@@ -301,6 +301,7 @@ def create_drawer(display=None):
|
||||
restart_label.set_text(lv.SYMBOL.REFRESH+" Reset")
|
||||
restart_label.center()
|
||||
def reset_cb(e):
|
||||
mpos.ui.remove_and_stop_current_activity() # make sure current app, like camera, does cleanup, saves progress, stops hardware etc.
|
||||
import machine
|
||||
if hasattr(machine, 'reset'):
|
||||
machine.reset()
|
||||
@@ -317,7 +318,7 @@ def create_drawer(display=None):
|
||||
poweroff_label.center()
|
||||
def poweroff_cb(e):
|
||||
print("Power off action...")
|
||||
remove_and_stop_current_activity() # make sure current app, like camera, does cleanup, saves progress, stops hardware etc.
|
||||
mpos.ui.remove_and_stop_current_activity() # make sure current app, like camera, does cleanup, saves progress, stops hardware etc.
|
||||
import sys
|
||||
if sys.platform == "esp32":
|
||||
#On ESP32, there's no power off but there is a forever sleep
|
||||
|
||||
Reference in New Issue
Block a user