From e6a3cba14ee04fe11ac4d95a7b057841735868ff Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 1 Aug 2015 14:43:48 -0700 Subject: [PATCH] Move HackRF firmware launch out of portapack::shutdown --- firmware/application/portapack.cpp | 8 -------- firmware/application/ui_navigation.cpp | 13 +++++++++++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/firmware/application/portapack.cpp b/firmware/application/portapack.cpp index cacc4f61..9f4c361c 100644 --- a/firmware/application/portapack.cpp +++ b/firmware/application/portapack.cpp @@ -33,9 +33,6 @@ using namespace hackrf::one; #include "touch_adc.hpp" -#include "m4_startup.hpp" -#include "spi_image.hpp" - namespace portapack { portapack::IO io { @@ -157,11 +154,6 @@ void shutdown() { chSysDisable(); hackrf::one::reset(); - m4_init(portapack::spi_flash::hackrf, reinterpret_cast(0x10000000)); - - while(true) { - __WFE(); - } } extern "C" { diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 56c97283..21716ead 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -28,6 +28,9 @@ #include "ui_receiver.hpp" #include "portapack.hpp" +#include "m4_startup.hpp" +#include "spi_image.hpp" +using namespace portapack; namespace ui { @@ -98,7 +101,7 @@ void NavigationView::focus() { SystemMenuView::SystemMenuView(NavigationView& nav) { add_items<7>({ { - { "Receiver", [&nav](){ nav.push(new ReceiverView { nav, portapack::receiver_model }); } }, + { "Receiver", [&nav](){ nav.push(new ReceiverView { nav, receiver_model }); } }, { "Capture", [&nav](){ nav.push(new NotImplementedView { nav }); } }, { "Analyze", [&nav](){ nav.push(new NotImplementedView { nav }); } }, { "Setup", [&nav](){ nav.push(new SetupMenuView { nav }); } }, @@ -151,7 +154,13 @@ Context& SystemView::context() const { HackRFFirmwareView::HackRFFirmwareView(NavigationView& nav) { button_yes.on_select = [&nav](Button&){ - portapack::shutdown(); + shutdown(); + + m4_init(spi_flash::hackrf, reinterpret_cast(0x10000000)); + + while(true) { + __WFE(); + } }; button_no.on_select = [&nav](Button&){