Move HackRF firmware launch out of portapack::shutdown

This commit is contained in:
Jared Boone 2015-08-01 14:43:48 -07:00
parent 96babc3e84
commit e6a3cba14e
2 changed files with 11 additions and 10 deletions

View File

@ -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<void*>(0x10000000));
while(true) {
__WFE();
}
}
extern "C" {

View File

@ -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<void*>(0x10000000));
while(true) {
__WFE();
}
};
button_no.on_select = [&nav](Button&){