From 8505884b07abc66d021a9ae9a24d907a6e515bc2 Mon Sep 17 00:00:00 2001 From: Marek Ventur Date: Wed, 29 Aug 2018 13:06:54 +0100 Subject: [PATCH] Add mass storage enabling app --- mass_storage/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 mass_storage/main.py diff --git a/mass_storage/main.py b/mass_storage/main.py new file mode 100644 index 0000000..d4211a4 --- /dev/null +++ b/mass_storage/main.py @@ -0,0 +1,20 @@ +"""Enables mass storage mode in a safe way""" + +___name___ = "Mass Storage Enabler" +___license___ = "MIT" +___dependencies___ = ["dialogs", "ugfx_helper"] +___categories___ = ["EMF"] +___bootstrapped___ = True + +import ugfx, tilda, ugfx_helper, dialogs + +ugfx_helper.init() +ugfx.clear() + +print("enabling USB storage...") +tilda.storage_enable_usb() +print("DONE") +with dialogs.WaitingMessage(title="Mass Storage Enabled", text="You can now use the badge like a USB key.\nPlease safely eject afterwards. This app will close automatically."): + print("Waiting for USB mass storage to be unmounted...") + tilda.storage_disable_usb() + print("DONE")