Push hardware peripherals debug views into a sub-menu.

This commit is contained in:
Jared Boone 2016-02-12 15:05:47 -08:00
parent 4321deee1e
commit 7d60b940d6
2 changed files with 20 additions and 6 deletions

View File

@ -242,13 +242,10 @@ void RegistersView::focus() {
button_done.focus(); button_done.focus();
} }
/* DebugMenuView *********************************************************/ /* DebugPeripheralsMenuView **********************************************/
DebugMenuView::DebugMenuView(NavigationView& nav) { DebugPeripheralsMenuView::DebugPeripheralsMenuView(NavigationView& nav) {
add_items<8>({ { add_items<4>({ {
{ "Memory", [&nav](){ nav.push<DebugMemoryView>(); } },
{ "Radio State", [&nav](){ nav.push<NotImplementedView>(); } },
{ "SD Card", [&nav](){ nav.push<NotImplementedView>(); } },
{ "RFFC5072", [&nav](){ nav.push<RegistersView>( { "RFFC5072", [&nav](){ nav.push<RegistersView>(
"RFFC5072", RegistersWidgetConfig { 31, 2, 4, 4 }, "RFFC5072", RegistersWidgetConfig { 31, 2, 4, 4 },
[](const size_t register_number) { return radio::first_if.read(register_number); } [](const size_t register_number) { return radio::first_if.read(register_number); }
@ -265,6 +262,18 @@ DebugMenuView::DebugMenuView(NavigationView& nav) {
"WM8731", RegistersWidgetConfig { audio::debug::reg_count(), 1, 3, 4 }, "WM8731", RegistersWidgetConfig { audio::debug::reg_count(), 1, 3, 4 },
[](const size_t register_number) { return audio::debug::reg_read(register_number); } [](const size_t register_number) { return audio::debug::reg_read(register_number); }
); } }, ); } },
} });
on_left = [&nav](){ nav.pop(); };
}
/* DebugMenuView *********************************************************/
DebugMenuView::DebugMenuView(NavigationView& nav) {
add_items<8>({ {
{ "Memory", [&nav](){ nav.push<DebugMemoryView>(); } },
{ "Radio State", [&nav](){ nav.push<NotImplementedView>(); } },
{ "SD Card", [&nav](){ nav.push<NotImplementedView>(); } },
{ "Peripherals", [&nav](){ nav.push<DebugPeripheralsMenuView>(); } },
{ "Temperature", [&nav](){ nav.push<TemperatureView>(); } }, { "Temperature", [&nav](){ nav.push<TemperatureView>(); } },
} }); } });
on_left = [&nav](){ nav.pop(); }; on_left = [&nav](){ nav.pop(); };

View File

@ -208,6 +208,11 @@ private:
}; };
}; };
class DebugPeripheralsMenuView : public MenuView {
public:
DebugPeripheralsMenuView(NavigationView& nav);
};
class DebugMenuView : public MenuView { class DebugMenuView : public MenuView {
public: public:
DebugMenuView(NavigationView& nav); DebugMenuView(NavigationView& nav);