Ensure apps call restart_to_default() when finished

andrejusk/bday
Dave Arter 2018-08-31 16:20:30 +01:00
parent 02d3c1512b
commit a78c19d05c
4 changed files with 11 additions and 4 deletions

View File

@ -20,4 +20,5 @@ sim800.poweron()
notocall = prompt_text("Number to call:")
if (notocall):
sim800.call(notocall)
sim800.call(notocall)
restart_to_default()

View File

@ -47,3 +47,5 @@ while True:
notice(message, title=selection["title"])
else:
break
restart_to_default()

View File

@ -6,11 +6,12 @@ Todo: fix this, it doesn't work at at the moment
___name___ = "Synthesizers"
___license___ = "MIT"
___categories___ = ["Sound"]
___dependencies___ = ["speaker", "buttons", "ugfx_helper"]
___dependencies___ = ["speaker", "buttons", "ugfx_helper", "app"]
import ugfx, speaker, ugfx_helper
from tilda import Buttons
from buttons import *
from app import restart_to_default
ugfx_helper.init()
speaker.enabled(True)
@ -49,3 +50,4 @@ def mode_buttons():
speaker.stop()
mode_buttons() # Todo: Allow different modes and allow users to switch between them via joystick or something
restart_to_default()

View File

@ -2,10 +2,10 @@
___name___ = "Tilda Torch"
___license___ = "MIT"
___dependencies___ = ["sleep"]
___dependencies___ = ["sleep", "app"]
___categories___ = ["EMF"]
import ugfx, os, time, sleep
import ugfx, os, time, sleep, app
from tilda import Buttons
from machine import Pin
@ -24,3 +24,5 @@ while (not Buttons.is_pressed(Buttons.BTN_A)) and (not Buttons.is_pressed(Button
torch.off()
ugfx.clear()
app.restart_to_default()