Merge pull request #50 from euquiq/H2-eried-branch

DEBUG -> PERIPHERALS is now a buttons based menu
This commit is contained in:
Erwin Ried 2020-06-05 19:52:46 +02:00 committed by GitHub
commit 9446e64784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -321,24 +321,24 @@ void DebugControlsView::focus() {
DebugPeripheralsMenuView::DebugPeripheralsMenuView(NavigationView& nav) {
add_items({
{ "RFFC5072", ui::Color::white(), nullptr, [&nav](){ nav.push<RegistersView>(
{ "RFFC5072", ui::Color::cyan(), &bitmap_icon_peripherals, [&nav](){ nav.push<RegistersView>(
"RFFC5072", RegistersWidgetConfig { 31, 16 },
[](const size_t register_number) { return radio::debug::first_if::register_read(register_number); }
); } },
{ "MAX2837", ui::Color::white(), nullptr, [&nav](){ nav.push<RegistersView>(
{ "MAX2837", ui::Color::cyan(), &bitmap_icon_peripherals, [&nav](){ nav.push<RegistersView>(
"MAX2837", RegistersWidgetConfig { 32, 10 },
[](const size_t register_number) { return radio::debug::second_if::register_read(register_number); }
); } },
{ "Si5351C", ui::Color::white(), nullptr, [&nav](){ nav.push<RegistersView>(
{ "Si5351C", ui::Color::cyan(), &bitmap_icon_peripherals, [&nav](){ nav.push<RegistersView>(
"Si5351C", RegistersWidgetConfig { 96, 8 },
[](const size_t register_number) { return portapack::clock_generator.read_register(register_number); }
); } },
{ audio::debug::codec_name(), ui::Color::white(), nullptr, [&nav](){ nav.push<RegistersView>(
{ audio::debug::codec_name(), ui::Color::cyan(), &bitmap_icon_peripherals, [&nav](){ nav.push<RegistersView>(
audio::debug::codec_name(), RegistersWidgetConfig { audio::debug::reg_count(), audio::debug::reg_bits() },
[](const size_t register_number) { return audio::debug::reg_read(register_number); }
); } },
});
on_left = [&nav](){ nav.pop(); };
set_max_rows(2); // allow wider buttons
}
/* DebugMenuView *********************************************************/

View File

@ -287,9 +287,10 @@ private:
};
};*/
class DebugPeripheralsMenuView : public MenuView {
class DebugPeripheralsMenuView : public BtnGridView {
public:
DebugPeripheralsMenuView(NavigationView& nav);
std::string title() const override { return "Peripherals"; };
};
class DebugMenuView : public BtnGridView {