mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-26 06:26:17 -05:00
Menu item to launch HackRF firmware.
This commit is contained in:
parent
8797aa9758
commit
fecbb7205e
@ -97,13 +97,14 @@ void NavigationView::focus() {
|
||||
/* SystemMenuView ********************************************************/
|
||||
|
||||
SystemMenuView::SystemMenuView(NavigationView& nav) {
|
||||
add_items<6>({ {
|
||||
{ "Receiver", [&nav](){ nav.push(new ReceiverView { nav, receiver_model }); } },
|
||||
add_items<7>({ {
|
||||
{ "Receiver", [&nav](){ nav.push(new ReceiverView { nav, portapack::receiver_model }); } },
|
||||
{ "Capture", [&nav](){ nav.push(new NotImplementedView { nav }); } },
|
||||
{ "Analyze", [&nav](){ nav.push(new NotImplementedView { nav }); } },
|
||||
{ "Setup", [&nav](){ nav.push(new SetupMenuView { nav }); } },
|
||||
{ "About", [&nav](){ nav.push(new AboutView { nav }); } },
|
||||
{ "Debug", [&nav](){ nav.push(new DebugMenuView { nav }); } },
|
||||
{ "HackRF", [&nav](){ nav.push(new HackRFFirmwareView { nav }); } },
|
||||
} });
|
||||
}
|
||||
|
||||
@ -146,6 +147,29 @@ Context& SystemView::context() const {
|
||||
return context_;
|
||||
}
|
||||
|
||||
/* HackRFFirmwareView ****************************************************/
|
||||
|
||||
HackRFFirmwareView::HackRFFirmwareView(NavigationView& nav) {
|
||||
button_yes.on_select = [&nav](Button&){
|
||||
// TODO: Clear screen?
|
||||
portapack::shutdown();
|
||||
};
|
||||
|
||||
button_no.on_select = [&nav](Button&){
|
||||
nav.pop();
|
||||
};
|
||||
|
||||
add_children({ {
|
||||
&text_title,
|
||||
&button_yes,
|
||||
&button_no,
|
||||
} });
|
||||
}
|
||||
|
||||
void HackRFFirmwareView::focus() {
|
||||
button_no.focus();
|
||||
}
|
||||
|
||||
/* NotImplementedView ****************************************************/
|
||||
|
||||
NotImplementedView::NotImplementedView(NavigationView& nav) {
|
||||
|
@ -107,6 +107,29 @@ private:
|
||||
Context& context_;
|
||||
};
|
||||
|
||||
class HackRFFirmwareView : public View {
|
||||
public:
|
||||
HackRFFirmwareView(NavigationView& nav);
|
||||
|
||||
void focus() override;
|
||||
|
||||
private:
|
||||
Text text_title {
|
||||
{ 5 * 8, 7 * 16, 19 * 8, 16 },
|
||||
"Execute HackRF Firmware?"
|
||||
};
|
||||
|
||||
Button button_yes {
|
||||
{ 4 * 8, 13 * 16, 8 * 8, 24 },
|
||||
"Yes",
|
||||
};
|
||||
|
||||
Button button_no {
|
||||
{ 18 * 8, 13 * 16, 8 * 8, 24 },
|
||||
"No",
|
||||
};
|
||||
};
|
||||
|
||||
class NotImplementedView : public View {
|
||||
public:
|
||||
NotImplementedView(NavigationView& nav);
|
||||
|
Loading…
x
Reference in New Issue
Block a user