From d04c781ada7ecba185f9a892dd350aa6446e2958 Mon Sep 17 00:00:00 2001 From: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com> Date: Fri, 16 Feb 2024 00:18:33 -0600 Subject: [PATCH] Added Reboot app to Debug menu (#1904) --- firmware/application/apps/ui_debug.cpp | 12 ++++++++++++ firmware/application/apps/ui_debug.hpp | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/firmware/application/apps/ui_debug.cpp b/firmware/application/apps/ui_debug.cpp index bc799098..1cb70410 100644 --- a/firmware/application/apps/ui_debug.cpp +++ b/firmware/application/apps/ui_debug.cpp @@ -457,6 +457,17 @@ DebugPeripheralsMenuView::DebugPeripheralsMenuView(NavigationView& nav) { set_max_rows(2); // allow wider buttons } +/* DebugReboot **********************************************/ + +DebugReboot::DebugReboot(NavigationView& nav) { + (void)nav; + + LPC_RGU->RESET_CTRL[0] = (1 << 0); + + while (1) + __WFE(); +} + /* DebugMenuView *********************************************************/ DebugMenuView::DebugMenuView(NavigationView& nav) { @@ -472,6 +483,7 @@ DebugMenuView::DebugMenuView(NavigationView& nav) { {"Peripherals", ui::Color::dark_cyan(), &bitmap_icon_peripherals, [&nav]() { nav.push(); }}, {"Pers. Memory", ui::Color::dark_cyan(), &bitmap_icon_memory, [&nav]() { nav.push(); }}, //{ "Radio State", ui::Color::white(), nullptr, [&nav](){ nav.push(); } }, + {"Reboot", ui::Color::dark_cyan(), &bitmap_icon_setup, [&nav]() { nav.push(); }}, {"SD Card", ui::Color::dark_cyan(), &bitmap_icon_sdcard, [&nav]() { nav.push(); }}, {"Temperature", ui::Color::dark_cyan(), &bitmap_icon_temperature, [&nav]() { nav.push(); }}, {"Touch Test", ui::Color::dark_cyan(), &bitmap_icon_notepad, [&nav]() { nav.push(); }}, diff --git a/firmware/application/apps/ui_debug.hpp b/firmware/application/apps/ui_debug.hpp index e25ce037..571e2bfd 100644 --- a/firmware/application/apps/ui_debug.hpp +++ b/firmware/application/apps/ui_debug.hpp @@ -424,6 +424,11 @@ class DebugPeripheralsMenuView : public BtnGridView { std::string title() const override { return "Peripherals"; }; }; +class DebugReboot : public BtnGridView { + public: + DebugReboot(NavigationView& nav); +}; + class DebugMenuView : public BtnGridView { public: DebugMenuView(NavigationView& nav);