Move ResetIntoBootloader activity to Settings app

This commit is contained in:
Thomas Farstrike
2026-01-25 23:37:39 +01:00
parent 77974685ba
commit b23107ee14
3 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -50,7 +50,6 @@ from .ui.widget_animator import WidgetAnimator
from .ui import focus_direction
# Utility modules
from . import bootloader
from . import ui
from . import config
from . import net
@@ -95,7 +94,7 @@ __all__ = [
"get_all_widgets_with_text",
# Submodules
"ui", "config", "net", "content", "time", "sensor_manager",
"camera_manager", "sdcard", "audio", "hardware", "bootloader",
"camera_manager", "sdcard", "audio", "hardware",
# Timezone utilities
"TimeZone"
]
@@ -1,26 +0,0 @@
import lvgl as lv
from .app.activity import Activity
class ResetIntoBootloader(Activity):
message = "Bootloader mode activated.\nYou can now install firmware over USB.\n\nReset the device to cancel."
def onCreate(self):
print(self.message)
screen = lv.obj()
label = lv.label(screen)
label.set_text(self.message)
label.center()
self.setContentView(screen)
def onResume(self, screen):
print("Starting start_bootloader time so the UI has time to update")
timer = lv.timer_create(self.start_bootloader, 1000, None).set_repeat_count(1)
def start_bootloader(self, timer):
try:
import machine
machine.bootloader()
except Exception as e:
print(f"Could not reset into bootloader because: {e}")