From a78c19d05c5e11ab0bc2155a91368284e675bc89 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 31 Aug 2018 16:20:30 +0100 Subject: [PATCH] Ensure apps call restart_to_default() when finished --- phone/main.py | 3 ++- sms/main.py | 2 ++ synth/main.py | 4 +++- tildatorch/main.py | 6 ++++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/phone/main.py b/phone/main.py index 7ae687c..f966255 100644 --- a/phone/main.py +++ b/phone/main.py @@ -20,4 +20,5 @@ sim800.poweron() notocall = prompt_text("Number to call:") if (notocall): - sim800.call(notocall) + sim800.call(notocall) +restart_to_default() diff --git a/sms/main.py b/sms/main.py index a34431f..e2c411f 100644 --- a/sms/main.py +++ b/sms/main.py @@ -47,3 +47,5 @@ while True: notice(message, title=selection["title"]) else: break + +restart_to_default() diff --git a/synth/main.py b/synth/main.py index 7b17eb6..ddc848f 100644 --- a/synth/main.py +++ b/synth/main.py @@ -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() diff --git a/tildatorch/main.py b/tildatorch/main.py index f14d8b5..73bbcd2 100644 --- a/tildatorch/main.py +++ b/tildatorch/main.py @@ -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()