Skip to content

Commit 806219f

Browse files
authored
Added menu group for transceivers (portapack-mayhem#2623)
* Added menu group for transceivers * Reorder apps icons
1 parent a153cbf commit 806219f

8 files changed

Lines changed: 78 additions & 4 deletions

File tree

firmware/application/apps/ui_external_module_view.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ void ExternalModuleView::on_tick_second() {
9292
case app_location_t::TX:
9393
btnText += " (TX)";
9494
break;
95+
case app_location_t::TRX:
96+
btnText += " (TRX)";
97+
break;
9598
case app_location_t::SETTINGS:
9699
btnText += " (Settings)";
97100
break;

firmware/application/bitmap.hpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4221,6 +4221,44 @@ static constexpr Bitmap bitmap_icon_tpms{
42214221
{16, 16},
42224222
bitmap_icon_tpms_data};
42234223

4224+
static constexpr uint8_t bitmap_icon_tranceivers_data[] = {
4225+
0x80,
4226+
0x01,
4227+
0xC0,
4228+
0x03,
4229+
0xE0,
4230+
0x07,
4231+
0xB0,
4232+
0x0D,
4233+
0x98,
4234+
0x19,
4235+
0x80,
4236+
0x01,
4237+
0x80,
4238+
0x01,
4239+
0x80,
4240+
0x01,
4241+
0x98,
4242+
0x19,
4243+
0xB0,
4244+
0x0D,
4245+
0xE0,
4246+
0x07,
4247+
0xC0,
4248+
0x03,
4249+
0x83,
4250+
0xC1,
4251+
0x03,
4252+
0xC0,
4253+
0xFF,
4254+
0xFF,
4255+
0xFF,
4256+
0xFF,
4257+
};
4258+
static constexpr Bitmap bitmap_icon_tranceivers{
4259+
{16, 16},
4260+
bitmap_icon_tranceivers_data};
4261+
42244262
static constexpr uint8_t bitmap_icon_transmit_data[] = {
42254263
0x80,
42264264
0x01,

firmware/application/external/remote/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ __attribute__((section(".external_app.app_remote.application_information"), used
7575
},
7676
/*.icon_color = */ ui::Color::green().v,
7777
/*.menu_location = */ app_location_t::HOME,
78-
/*.desired_menu_position = */ 4,
78+
/*.desired_menu_position = */ 6,
7979

8080
/*.m4_app_tag = portapack::spi_flash::image_tag_replay */ {'P', 'R', 'E', 'P'},
8181
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time

firmware/application/ui_navigation.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ const NavigationView::AppList NavigationView::appList = {
117117
/* HOME ******************************************************************/
118118
{nullptr, "Receive", HOME, Color::cyan(), &bitmap_icon_receivers, new ViewFactory<ReceiversMenuView>()},
119119
{nullptr, "Transmit", HOME, Color::cyan(), &bitmap_icon_transmit, new ViewFactory<TransmittersMenuView>()},
120+
{nullptr, "Tranceiver", HOME, Color::cyan(), &bitmap_icon_tranceivers, new ViewFactory<TranceiversMenuView>()},
121+
{"recon", "Recon", HOME, Color::green(), &bitmap_icon_scanner, new ViewFactory<ReconView>()},
120122
{"capture", "Capture", HOME, Color::red(), &bitmap_icon_capture, new ViewFactory<CaptureAppView>()},
121123
{"replay", "Replay", HOME, Color::green(), &bitmap_icon_replay, new ViewFactory<PlaylistView>()},
122-
{"recon", "Recon", HOME, Color::green(), &bitmap_icon_scanner, new ViewFactory<ReconView>()},
123-
{"microphone", "Microphone", HOME, Color::green(), &bitmap_icon_microphone, new ViewFactory<MicTXView>()},
124124
{"lookingglass", "Looking Glass", HOME, Color::green(), &bitmap_icon_looking, new ViewFactory<GlassView>()},
125125
{nullptr, "Utilities", HOME, Color::cyan(), &bitmap_icon_utilities, new ViewFactory<UtilitiesMenuView>()},
126126
{nullptr, "Games", HOME, Color::cyan(), &bitmap_icon_games, new ViewFactory<GamesMenuView>()},
@@ -147,6 +147,8 @@ const NavigationView::AppList NavigationView::appList = {
147147
{"soundbrd", "Soundbrd", TX, ui::Color::green(), &bitmap_icon_soundboard, new ViewFactory<SoundBoardView>()},
148148
{"touchtune", "TouchTune", TX, ui::Color::green(), &bitmap_icon_touchtunes, new ViewFactory<TouchTunesView>()},
149149
{"signalgen", "SignalGen", TX, Color::green(), &bitmap_icon_cwgen, new ViewFactory<SigGenView>()},
150+
/* TRX ********************************************************************/
151+
{"microphone", "Mic", TRX, Color::green(), &bitmap_icon_microphone, new ViewFactory<MicTXView>()},
150152
/* UTILITIES *************************************************************/
151153
{"filemanager", "File Manager", UTILITIES, Color::green(), &bitmap_icon_dir, new ViewFactory<FileManagerView>()},
152154
{"freqman", "Freq. Manager", UTILITIES, Color::green(), &bitmap_icon_freqman, new ViewFactory<FrequencyManagerView>()},
@@ -841,6 +843,20 @@ void TransmittersMenuView::on_populate() {
841843
add_external_items(nav_, app_location_t::TX, *this, return_icon ? 1 : 0);
842844
}
843845

846+
/* TranceiversMenuView **************************************************/
847+
848+
TranceiversMenuView::TranceiversMenuView(NavigationView& nav)
849+
: nav_(nav) {}
850+
851+
void TranceiversMenuView::on_populate() {
852+
bool return_icon = pmem::show_gui_return_icon();
853+
if (return_icon) {
854+
add_items({{"..", Theme::getInstance()->fg_light->foreground, &bitmap_icon_previous, [this]() { nav_.pop(); }}});
855+
}
856+
add_apps(nav_, *this, TRX);
857+
add_external_items(nav_, app_location_t::TRX, *this, return_icon ? 1 : 0);
858+
}
859+
844860
/* UtilitiesMenuView *****************************************************/
845861

846862
UtilitiesMenuView::UtilitiesMenuView(NavigationView& nav)

firmware/application/ui_navigation.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,16 @@ class TransmittersMenuView : public BtnGridView {
379379
void on_populate() override;
380380
};
381381

382+
class TranceiversMenuView : public BtnGridView {
383+
public:
384+
TranceiversMenuView(NavigationView& nav);
385+
std::string title() const override { return "Tranceiver"; };
386+
387+
private:
388+
NavigationView& nav_;
389+
void on_populate() override;
390+
};
391+
382392
class UtilitiesMenuView : public BtnGridView {
383393
public:
384394
UtilitiesMenuView(NavigationView& nav);

firmware/application/usb_serial_shell.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,9 @@ static void printAppInfo(BaseSequentialStream* chp, ui::AppInfoConsole& element)
691691
case TX:
692692
chprintf(chp, "[TX]\r\n");
693693
break;
694+
case TRX:
695+
chprintf(chp, "[TRX]\r\n");
696+
break;
694697
case UTILITIES:
695698
chprintf(chp, "[UTIL]\r\n");
696699
break;
@@ -715,6 +718,9 @@ static void printAppInfo(BaseSequentialStream* chp, const ui::AppInfo& element)
715718
case TX:
716719
chprintf(chp, "[TX]\r\n");
717720
break;
721+
case TRX:
722+
chprintf(chp, "[TRX]\r\n");
723+
break;
718724
case UTILITIES:
719725
chprintf(chp, "[UTIL]\r\n");
720726
break;

firmware/common/standalone_app.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ enum app_location_t : uint32_t {
7373
DEBUG,
7474
HOME,
7575
SETTINGS,
76-
GAMES
76+
GAMES,
77+
TRX
7778
};
7879

7980
struct standalone_application_information_t {
185 Bytes
Loading

0 commit comments

Comments
 (0)