diff --git a/firmware/application/CMakeLists.txt b/firmware/application/CMakeLists.txt index c2f5bd5d..8b4ce16c 100644 --- a/firmware/application/CMakeLists.txt +++ b/firmware/application/CMakeLists.txt @@ -303,7 +303,6 @@ set(CPPSRC apps/ui_rds.cpp apps/ui_recon_settings.cpp apps/ui_recon.cpp - apps/ui_remote.cpp apps/ui_scanner.cpp apps/ui_sd_over_usb.cpp apps/ui_sd_wipe.cpp diff --git a/firmware/application/apps/ui_fileman.cpp b/firmware/application/apps/ui_fileman.cpp index 3351cc84..e0ea09ec 100644 --- a/firmware/application/apps/ui_fileman.cpp +++ b/firmware/application/apps/ui_fileman.cpp @@ -27,7 +27,6 @@ #include #include "ui_fileman.hpp" #include "ui_playlist.hpp" -#include "ui_remote.hpp" #include "ui_ss_viewer.hpp" #include "ui_bmp_file_viewer.hpp" #include "ui_text_editor.hpp" @@ -704,10 +703,11 @@ bool FileManagerView::handle_file_open() { reload_current(false); return true; - } else if (path_iequal(rem_ext, ext)) { + } + /*else if (path_iequal(rem_ext, ext)) { nav_.push(path); return true; - } + }*/ return false; } diff --git a/firmware/application/bitmap.hpp b/firmware/application/bitmap.hpp index 37ef8690..f8105b58 100644 --- a/firmware/application/bitmap.hpp +++ b/firmware/application/bitmap.hpp @@ -363,6 +363,44 @@ static constexpr Bitmap bitmap_icon_downconvert{ {16, 16}, bitmap_icon_downconvert_data}; +static constexpr uint8_t bitmap_icon_speaker_and_headphones_data[] = { + 0x20, + 0x10, + 0x30, + 0x20, + 0x38, + 0x44, + 0x3E, + 0x48, + 0x3E, + 0x91, + 0x3E, + 0x92, + 0x38, + 0x92, + 0x30, + 0x92, + 0x20, + 0x92, + 0x00, + 0x92, + 0x30, + 0x91, + 0x48, + 0x48, + 0x84, + 0x44, + 0x84, + 0x20, + 0x86, + 0x11, + 0x86, + 0x01, +}; +static constexpr Bitmap bitmap_icon_speaker_and_headphones{ + {16, 16}, + bitmap_icon_speaker_and_headphones_data}; + static constexpr uint8_t bitmap_more_data[] = { 0x10, 0x10, @@ -987,6 +1025,44 @@ static constexpr Bitmap bitmap_icon_tools_antenna{ {16, 16}, bitmap_icon_tools_antenna_data}; +static constexpr uint8_t bitmap_icon_batt_text_data[] = { + 0x00, + 0x00, + 0x30, + 0x06, + 0x48, + 0x09, + 0x48, + 0x09, + 0x70, + 0x0E, + 0x40, + 0x08, + 0x30, + 0x06, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x48, + 0x00, + 0x20, + 0x00, + 0x10, + 0x00, + 0x48, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_batt_text{ + {16, 16}, + bitmap_icon_batt_text_data}; + static constexpr uint8_t bitmap_icon_new_file_data[] = { 0x00, 0x00, @@ -1289,6 +1365,44 @@ static constexpr Bitmap bitmap_icon_stealth{ {16, 16}, bitmap_icon_stealth_data}; +static constexpr uint8_t bitmap_key_data[] = { + 0xC0, + 0x03, + 0xE0, + 0x07, + 0x30, + 0x0C, + 0x30, + 0x0C, + 0x30, + 0x0C, + 0x30, + 0x0C, + 0xE0, + 0x07, + 0xC0, + 0x03, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x07, + 0x80, + 0x03, + 0x80, + 0x07, + 0x80, + 0x01, +}; +static constexpr Bitmap bitmap_key{ + {16, 16}, + bitmap_key_data}; + static constexpr uint8_t bitmap_sig_square_data[] = { 0x00, 0x00, @@ -1727,6 +1841,44 @@ static constexpr Bitmap bitmap_icon_soundboard{ {16, 16}, bitmap_icon_soundboard_data}; +static constexpr uint8_t bitmap_icon_tetris_data[] = { + 0xF8, + 0xFF, + 0x88, + 0x88, + 0x88, + 0x88, + 0x88, + 0x88, + 0xF8, + 0xFF, + 0x80, + 0x08, + 0x80, + 0x08, + 0x9F, + 0x08, + 0x91, + 0x0F, + 0x11, + 0x00, + 0x11, + 0x00, + 0xFF, + 0xF1, + 0x11, + 0x91, + 0x11, + 0x91, + 0x11, + 0x91, + 0xFF, + 0xF1, +}; +static constexpr Bitmap bitmap_icon_tetris{ + {16, 16}, + bitmap_icon_tetris_data}; + static constexpr uint8_t bitmap_icon_rename_data[] = { 0x00, 0x00, @@ -2091,6 +2243,44 @@ static constexpr Bitmap bitmap_icon_dmr{ {16, 16}, bitmap_icon_dmr_data}; +static constexpr uint8_t bitmap_arrow_right_data[] = { + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x04, + 0x00, + 0x0C, + 0x00, + 0x1C, + 0xFE, + 0x3F, + 0xFE, + 0x7F, + 0xFE, + 0x3F, + 0x00, + 0x1C, + 0x00, + 0x0C, + 0x00, + 0x04, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_arrow_right{ + {16, 16}, + bitmap_arrow_right_data}; + static constexpr uint8_t bitmap_icon_upconvert_data[] = { 0x80, 0x01, @@ -2129,6 +2319,82 @@ static constexpr Bitmap bitmap_icon_upconvert{ {16, 16}, bitmap_icon_upconvert_data}; +static constexpr uint8_t bitmap_icon_hide_data[] = { + 0x00, + 0x00, + 0x00, + 0x40, + 0x00, + 0x20, + 0xE0, + 0x17, + 0x18, + 0x18, + 0xC4, + 0x27, + 0x62, + 0x42, + 0x21, + 0x85, + 0xA1, + 0x84, + 0x62, + 0x46, + 0xA4, + 0x23, + 0x18, + 0x18, + 0xE8, + 0x07, + 0x04, + 0x00, + 0x02, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_hide{ + {16, 16}, + bitmap_icon_hide_data}; + +static constexpr uint8_t bitmap_icon_add_data[] = { + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0xF8, + 0x1F, + 0xF8, + 0x1F, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x80, + 0x01, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_add{ + {16, 16}, + bitmap_icon_add_data}; + static constexpr uint8_t bitmap_icon_clk_int_data[] = { 0x00, 0x00, @@ -2227,6 +2493,44 @@ static constexpr Bitmap bitmap_icon_file_image{ {16, 16}, bitmap_icon_file_image_data}; +static constexpr uint8_t bitmap_icon_batt_icon_data[] = { + 0xC0, + 0x03, + 0xC0, + 0x03, + 0xF0, + 0x0F, + 0x10, + 0x08, + 0x10, + 0x08, + 0x10, + 0x08, + 0x10, + 0x08, + 0x10, + 0x08, + 0xF0, + 0x0F, + 0xF0, + 0x0F, + 0xF0, + 0x0F, + 0xF0, + 0x0F, + 0xF0, + 0x0F, + 0xF0, + 0x0F, + 0xF0, + 0x0F, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_batt_icon{ + {16, 16}, + bitmap_icon_batt_icon_data}; + static constexpr uint8_t bitmap_icon_temperature_data[] = { 0x00, 0x01, @@ -2333,6 +2637,82 @@ static constexpr Bitmap bitmap_icon_sdcard{ {16, 16}, bitmap_icon_sdcard_data}; +static constexpr uint8_t bitmap_icon_clean_data[] = { + 0x00, + 0x00, + 0xC0, + 0x01, + 0x20, + 0x02, + 0xFC, + 0x1F, + 0x00, + 0x00, + 0x08, + 0x08, + 0xE8, + 0x08, + 0xA8, + 0x09, + 0xA8, + 0x0B, + 0x28, + 0x0A, + 0x28, + 0x0A, + 0x28, + 0x0A, + 0xE8, + 0x0B, + 0x08, + 0x08, + 0xF0, + 0x07, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_clean{ + {16, 16}, + bitmap_icon_clean_data}; + +static constexpr uint8_t bitmap_icon_touchtunes_data[] = { + 0xE0, + 0x07, + 0x30, + 0x0C, + 0x7C, + 0x3E, + 0xC4, + 0x23, + 0x26, + 0x64, + 0x12, + 0x48, + 0x0F, + 0xF3, + 0x09, + 0x95, + 0x0F, + 0xF1, + 0x09, + 0x91, + 0x0F, + 0xF1, + 0xC9, + 0x91, + 0xE9, + 0x91, + 0xC9, + 0x90, + 0x0F, + 0xF0, + 0xFF, + 0xFF, +}; +static constexpr Bitmap bitmap_icon_touchtunes{ + {16, 16}, + bitmap_icon_touchtunes_data}; + static constexpr uint8_t bitmap_icon_file_iq_data[] = { 0xFC, 0x03, @@ -2447,82 +2827,6 @@ static constexpr Bitmap bitmap_icon_camera{ {16, 16}, bitmap_icon_camera_data}; -static constexpr uint8_t bitmap_icon_batt_icon_data[] = { - 0xC0, - 0x03, - 0xC0, - 0x03, - 0xF0, - 0x0F, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0x10, - 0x08, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - 0xF0, - 0x0F, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_batt_icon{ - {16, 16}, - bitmap_icon_batt_icon_data}; - -static constexpr uint8_t bitmap_icon_batt_text_data[] = { - 0x00, - 0x00, - 0x30, - 0x06, - 0x48, - 0x09, - 0x48, - 0x09, - 0x70, - 0x0E, - 0x40, - 0x08, - 0x30, - 0x06, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x48, - 0x00, - 0x20, - 0x00, - 0x10, - 0x00, - 0x48, - 0x00, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_batt_text{ - {16, 16}, - bitmap_icon_batt_text_data}; - static constexpr uint8_t bitmap_icon_tools_wipesd_data[] = { 0xF0, 0x3F, @@ -2637,6 +2941,44 @@ static constexpr Bitmap bitmap_icon_freqman{ {16, 16}, bitmap_icon_freqman_data}; +static constexpr uint8_t bitmap_icon_thermometer_data[] = { + 0xC0, + 0x00, + 0x20, + 0x01, + 0x10, + 0x02, + 0x10, + 0x3A, + 0x10, + 0x02, + 0x10, + 0x1A, + 0x10, + 0x02, + 0xD0, + 0x3A, + 0xD0, + 0x02, + 0xD0, + 0x1A, + 0xD0, + 0x02, + 0xE8, + 0x05, + 0xE8, + 0x05, + 0xC8, + 0x04, + 0x10, + 0x02, + 0xE0, + 0x01, +}; +static constexpr Bitmap bitmap_icon_thermometer{ + {16, 16}, + bitmap_icon_thermometer_data}; + static constexpr uint8_t bitmap_sd_card_ok_data[] = { 0x00, 0x00, @@ -2903,6 +3245,44 @@ static constexpr Bitmap bitmap_icon_bht{ {16, 16}, bitmap_icon_bht_data}; +static constexpr uint8_t bitmap_icon_shift_data[] = { + 0x00, + 0x00, + 0x80, + 0x00, + 0xC0, + 0x01, + 0xE0, + 0x03, + 0xF0, + 0x07, + 0xF8, + 0x0F, + 0xFC, + 0x1F, + 0xE0, + 0x03, + 0xE0, + 0x03, + 0xE0, + 0x03, + 0x20, + 0x02, + 0xE0, + 0x03, + 0x20, + 0x02, + 0xE0, + 0x03, + 0x00, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_shift{ + {16, 16}, + bitmap_icon_shift_data}; + static constexpr uint8_t bitmap_play_data[] = { 0x00, 0x00, @@ -3113,6 +3493,44 @@ static constexpr Bitmap bitmap_sig_saw_down{ {32, 32}, bitmap_sig_saw_down_data}; +static constexpr uint8_t bitmap_icon_font_viewer_data[] = { + 0x00, + 0x00, + 0x00, + 0x00, + 0x10, + 0x0C, + 0x38, + 0x0C, + 0x38, + 0x0C, + 0x6C, + 0x0C, + 0x6C, + 0x0C, + 0xC6, + 0x7C, + 0xFE, + 0xFC, + 0xFF, + 0x8D, + 0x83, + 0x8D, + 0x83, + 0xFD, + 0x01, + 0x7D, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_font_viewer{ + {16, 16}, + bitmap_icon_font_viewer_data}; + static constexpr uint8_t bitmap_icon_load_data[] = { 0x00, 0x01, @@ -3343,6 +3761,44 @@ static constexpr Bitmap bitmap_icon_sleep{ {16, 16}, bitmap_icon_sleep_data}; +static constexpr uint8_t bitmap_icon_paint_data[] = { + 0xFE, + 0x3F, + 0xFF, + 0x3F, + 0xFF, + 0xFF, + 0xFF, + 0xBF, + 0xFE, + 0xBF, + 0x00, + 0x80, + 0x80, + 0xFF, + 0x80, + 0x00, + 0x80, + 0x00, + 0xC0, + 0x01, + 0xC0, + 0x01, + 0xC0, + 0x01, + 0xC0, + 0x01, + 0xC0, + 0x01, + 0xC0, + 0x01, + 0xC0, + 0x01, +}; +static constexpr Bitmap bitmap_icon_paint{ + {16, 16}, + bitmap_icon_paint_data}; + static constexpr uint8_t bitmap_icon_notepad_data[] = { 0x0C, 0x00, @@ -3381,6 +3837,44 @@ static constexpr Bitmap bitmap_icon_notepad{ {16, 16}, bitmap_icon_notepad_data}; +static constexpr uint8_t bitmap_icon_trim_data[] = { + 0x10, + 0x10, + 0x30, + 0x12, + 0x50, + 0x15, + 0x50, + 0x15, + 0x50, + 0x15, + 0x52, + 0x95, + 0x56, + 0xD5, + 0x5F, + 0xF5, + 0x56, + 0xD5, + 0x52, + 0x95, + 0x50, + 0x15, + 0x50, + 0x15, + 0x50, + 0x15, + 0x90, + 0x18, + 0x10, + 0x10, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_trim{ + {16, 16}, + bitmap_icon_trim_data}; + static constexpr uint8_t bitmap_icon_copy_data[] = { 0x00, 0x00, @@ -3895,44 +4389,6 @@ static constexpr Bitmap bitmap_icon_looking{ {16, 16}, bitmap_icon_looking_data}; -static constexpr uint8_t bitmap_icon_add_data[] = { - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x80, - 0x01, - 0x80, - 0x01, - 0x80, - 0x01, - 0x80, - 0x01, - 0xF8, - 0x1F, - 0xF8, - 0x1F, - 0x80, - 0x01, - 0x80, - 0x01, - 0x80, - 0x01, - 0x80, - 0x01, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_add{ - {16, 16}, - bitmap_icon_add_data}; - static constexpr uint8_t bitmap_icon_delete_data[] = { 0x00, 0x00, @@ -4575,6 +5031,44 @@ static constexpr Bitmap bitmap_icon_btle{ {16, 16}, bitmap_icon_btle_data}; +static constexpr uint8_t bitmap_arrow_left_data[] = { + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x20, + 0x00, + 0x30, + 0x00, + 0x38, + 0x00, + 0xFC, + 0x7F, + 0xFE, + 0x7F, + 0xFC, + 0x7F, + 0x38, + 0x00, + 0x30, + 0x00, + 0x20, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_arrow_left{ + {16, 16}, + bitmap_arrow_left_data}; + static constexpr uint8_t bitmap_sd_card_error_data[] = { 0x00, 0x00, @@ -4747,6 +5241,44 @@ static constexpr Bitmap bitmap_sig_saw_up{ {32, 32}, bitmap_sig_saw_up_data}; +static constexpr uint8_t bitmap_icon_brightness_data[] = { + 0x00, + 0x00, + 0x80, + 0x01, + 0x84, + 0x21, + 0x08, + 0x10, + 0xC0, + 0x03, + 0xE0, + 0x07, + 0xF0, + 0x0F, + 0xF6, + 0x6F, + 0xF6, + 0x6F, + 0xF0, + 0x0F, + 0xE0, + 0x07, + 0xC0, + 0x03, + 0x08, + 0x10, + 0x84, + 0x21, + 0x80, + 0x01, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_brightness{ + {16, 16}, + bitmap_icon_brightness_data}; + static constexpr uint8_t bitmap_icon_microphone_data[] = { 0xC0, 0x03, @@ -5417,234 +5949,6 @@ static constexpr Bitmap bitmap_target{ {16, 16}, bitmap_target_data}; -static constexpr uint8_t bitmap_icon_new_dir_data[] = { - 0x00, - 0x00, - 0x1E, - 0x00, - 0x21, - 0x00, - 0xE1, - 0x7F, - 0x01, - 0xC0, - 0x81, - 0x81, - 0x81, - 0x81, - 0x81, - 0x81, - 0xF1, - 0x8F, - 0xF1, - 0x8F, - 0x81, - 0x81, - 0x81, - 0x81, - 0x81, - 0x81, - 0x03, - 0xC0, - 0xFE, - 0x7F, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_new_dir{ - {16, 16}, - bitmap_icon_new_dir_data}; - -static constexpr uint8_t bitmap_icon_paint_data[] = { - 0xFE, - 0x3F, - 0xFF, - 0x3F, - 0xFF, - 0xFF, - 0xFF, - 0xBF, - 0xFE, - 0xBF, - 0x00, - 0x80, - 0x80, - 0xFF, - 0x80, - 0x00, - 0x80, - 0x00, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, - 0xC0, - 0x01, -}; -static constexpr Bitmap bitmap_icon_paint{ - {16, 16}, - bitmap_icon_paint_data}; - -static constexpr uint8_t bitmap_icon_touchtunes_data[] = { - 0xE0, - 0x07, - 0x30, - 0x0C, - 0x7C, - 0x3E, - 0xC4, - 0x23, - 0x26, - 0x64, - 0x12, - 0x48, - 0x0F, - 0xF3, - 0x09, - 0x95, - 0x0F, - 0xF1, - 0x09, - 0x91, - 0x0F, - 0xF1, - 0xC9, - 0x91, - 0xE9, - 0x91, - 0xC9, - 0x90, - 0x0F, - 0xF0, - 0xFF, - 0xFF, -}; -static constexpr Bitmap bitmap_icon_touchtunes{ - {16, 16}, - bitmap_icon_touchtunes_data}; - -static constexpr uint8_t bitmap_arrow_left_data[] = { - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x20, - 0x00, - 0x30, - 0x00, - 0x38, - 0x00, - 0xFC, - 0x7F, - 0xFE, - 0x7F, - 0xFC, - 0x7F, - 0x38, - 0x00, - 0x30, - 0x00, - 0x20, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_arrow_left{ - {16, 16}, - bitmap_arrow_left_data}; - -static constexpr uint8_t bitmap_arrow_right_data[] = { - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x04, - 0x00, - 0x0C, - 0x00, - 0x1C, - 0xFE, - 0x3F, - 0xFE, - 0x7F, - 0xFE, - 0x3F, - 0x00, - 0x1C, - 0x00, - 0x0C, - 0x00, - 0x04, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_arrow_right{ - {16, 16}, - bitmap_arrow_right_data}; - -static constexpr uint8_t bitmap_icon_speaker_and_headphones_data[] = { - 0x20, - 0x10, - 0x30, - 0x20, - 0x38, - 0x44, - 0x3E, - 0x48, - 0x3E, - 0x91, - 0x3E, - 0x92, - 0x38, - 0x92, - 0x30, - 0x92, - 0x20, - 0x92, - 0x00, - 0x92, - 0x30, - 0x91, - 0x48, - 0x48, - 0x84, - 0x44, - 0x84, - 0x20, - 0x86, - 0x11, - 0x86, - 0x01, -}; -static constexpr Bitmap bitmap_icon_speaker_and_headphones{ - {16, 16}, - bitmap_icon_speaker_and_headphones_data}; - static constexpr uint8_t bitmap_icon_speaker_and_headphones_mute_data[] = { 0x40, 0x00, @@ -5683,233 +5987,81 @@ static constexpr Bitmap bitmap_icon_speaker_and_headphones_mute{ {16, 16}, bitmap_icon_speaker_and_headphones_mute_data}; -static constexpr uint8_t bitmap_icon_shift_data[] = { +static constexpr uint8_t bitmap_icon_new_dir_data[] = { 0x00, 0x00, - 0x80, + 0x1E, 0x00, - 0xC0, + 0x21, + 0x00, + 0xE1, + 0x7F, 0x01, - 0xE0, + 0xC0, + 0x81, + 0x81, + 0x81, + 0x81, + 0x81, + 0x81, + 0xF1, + 0x8F, + 0xF1, + 0x8F, + 0x81, + 0x81, + 0x81, + 0x81, + 0x81, + 0x81, 0x03, - 0xF0, - 0x07, + 0xC0, + 0xFE, + 0x7F, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_new_dir{ + {16, 16}, + bitmap_icon_new_dir_data}; + +static constexpr uint8_t bitmap_icon_protoview_data[] = { + 0x00, + 0x00, + 0x00, + 0x00, 0xF8, + 0x87, + 0x08, + 0x84, 0x0F, 0xFC, - 0x1F, - 0xE0, - 0x03, - 0xE0, - 0x03, - 0xE0, - 0x03, - 0x20, - 0x02, - 0xE0, - 0x03, - 0x20, - 0x02, - 0xE0, - 0x03, 0x00, 0x00, 0x00, 0x00, -}; -static constexpr Bitmap bitmap_icon_shift{ - {16, 16}, - bitmap_icon_shift_data}; - -static constexpr uint8_t bitmap_icon_trim_data[] = { - 0x10, - 0x10, - 0x30, + 0x00, + 0x00, + 0xF3, + 0xE0, + 0x92, + 0xA0, + 0x9E, + 0xBF, + 0x00, + 0x00, + 0x00, + 0x00, + 0xFC, + 0xF3, + 0x04, 0x12, - 0x50, - 0x15, - 0x50, - 0x15, - 0x50, - 0x15, - 0x52, - 0x95, - 0x56, - 0xD5, - 0x5F, - 0xF5, - 0x56, - 0xD5, - 0x52, - 0x95, - 0x50, - 0x15, - 0x50, - 0x15, - 0x50, - 0x15, - 0x90, - 0x18, - 0x10, - 0x10, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_trim{ - {16, 16}, - bitmap_icon_trim_data}; - -static constexpr uint8_t bitmap_icon_hide_data[] = { - 0x00, - 0x00, - 0x00, - 0x40, - 0x00, - 0x20, - 0xE0, - 0x17, - 0x18, - 0x18, - 0xC4, - 0x27, - 0x62, - 0x42, - 0x21, - 0x85, - 0xA1, - 0x84, - 0x62, - 0x46, - 0xA4, - 0x23, - 0x18, - 0x18, - 0xE8, 0x07, - 0x04, - 0x00, - 0x02, - 0x00, - 0x00, - 0x00, + 0x1E, }; -static constexpr Bitmap bitmap_icon_hide{ +static constexpr Bitmap bitmap_icon_protoview{ {16, 16}, - bitmap_icon_hide_data}; - -static constexpr uint8_t bitmap_icon_thermometer_data[] = { - 0xC0, - 0x00, - 0x20, - 0x01, - 0x10, - 0x02, - 0x10, - 0x3A, - 0x10, - 0x02, - 0x10, - 0x1A, - 0x10, - 0x02, - 0xD0, - 0x3A, - 0xD0, - 0x02, - 0xD0, - 0x1A, - 0xD0, - 0x02, - 0xE8, - 0x05, - 0xE8, - 0x05, - 0xC8, - 0x04, - 0x10, - 0x02, - 0xE0, - 0x01, -}; -static constexpr Bitmap bitmap_icon_thermometer{ - {16, 16}, - bitmap_icon_thermometer_data}; - -static constexpr uint8_t bitmap_icon_brightness_data[] = { - 0x00, - 0x00, - 0x80, - 0x01, - 0x84, - 0x21, - 0x08, - 0x10, - 0xC0, - 0x03, - 0xE0, - 0x07, - 0xF0, - 0x0F, - 0xF6, - 0x6F, - 0xF6, - 0x6F, - 0xF0, - 0x0F, - 0xE0, - 0x07, - 0xC0, - 0x03, - 0x08, - 0x10, - 0x84, - 0x21, - 0x80, - 0x01, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_brightness{ - {16, 16}, - bitmap_icon_brightness_data}; - -static constexpr uint8_t bitmap_icon_clean_data[] = { - 0x00, - 0x00, - 0xC0, - 0x01, - 0x20, - 0x02, - 0xFC, - 0x1F, - 0x00, - 0x00, - 0x08, - 0x08, - 0xE8, - 0x08, - 0xA8, - 0x09, - 0xA8, - 0x0B, - 0x28, - 0x0A, - 0x28, - 0x0A, - 0x28, - 0x0A, - 0xE8, - 0x0B, - 0x08, - 0x08, - 0xF0, - 0x07, - 0x00, - 0x00, -}; -static constexpr Bitmap bitmap_icon_clean{ - {16, 16}, - bitmap_icon_clean_data}; + bitmap_icon_protoview_data}; } /* namespace ui */ diff --git a/firmware/application/external/external.cmake b/firmware/application/external/external.cmake index c151b55c..b3fbb4f3 100644 --- a/firmware/application/external/external.cmake +++ b/firmware/application/external/external.cmake @@ -126,7 +126,10 @@ set(EXTCPPSRC #flippertx external/flippertx/main.cpp external/flippertx/ui_flippertx.cpp - + + #remote + external/remote/main.cpp + external/remote/ui_remote.cpp ) set(EXTAPPLIST @@ -160,4 +163,5 @@ set(EXTAPPLIST ook_editor shoppingcart_lock flippertx + remote ) diff --git a/firmware/application/external/external.ld b/firmware/application/external/external.ld index b4b3ac34..0e054cf5 100644 --- a/firmware/application/external/external.ld +++ b/firmware/application/external/external.ld @@ -53,6 +53,7 @@ MEMORY ram_external_app_ookbrute(rwx) : org = 0xADCC0000, len = 32k ram_external_app_flippertx(rwx) : org = 0xADCD0000, len = 32k ram_external_app_ook_editor(rwx) : org = 0xADCE0000, len = 32k + ram_external_app_remote(rwx) : org = 0xADCF0000, len = 32k } SECTIONS @@ -238,4 +239,9 @@ SECTIONS *(*ui*external_app*flippertx*); } > ram_external_app_flippertx + .external_app_remote : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.external_app.app_remote.application_information)); + *(*ui*external_app*remote*); + } > ram_external_app_remote } diff --git a/firmware/application/external/remote/main.cpp b/firmware/application/external/remote/main.cpp new file mode 100644 index 00000000..af7e5bc3 --- /dev/null +++ b/firmware/application/external/remote/main.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2024 gullradriel + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui.hpp" +#include "ui_remote.hpp" +#include "ui_navigation.hpp" +#include "external_app.hpp" + +namespace ui::external_app::remote { +void initialize_app(ui::NavigationView& nav) { + nav.push(); +} +} // namespace ui::external_app::remote + +extern "C" { + +__attribute__((section(".external_app.app_remote.application_information"), used)) application_information_t _application_information_remote = { + /*.memory_location = */ (uint8_t*)0x00000000, + /*.externalAppEntry = */ ui::external_app::remote::initialize_app, + /*.header_version = */ CURRENT_HEADER_VERSION, + /*.app_version = */ VERSION_MD5, + + /*.app_name = */ "Remote", + /*.bitmap_data = */ { + 0x20, + 0x00, + 0x20, + 0x00, + 0x20, + 0x00, + 0x20, + 0x00, + 0xE0, + 0x07, + 0xF0, + 0x0F, + 0x30, + 0x0C, + 0x30, + 0x0C, + 0xF0, + 0x0F, + 0xF0, + 0x0F, + 0x70, + 0x0D, + 0xB0, + 0x0E, + 0x70, + 0x0D, + 0xB0, + 0x0E, + 0xF0, + 0x0F, + 0xE0, + 0x07, + }, + /*.icon_color = */ ui::Color::green().v, + /*.menu_location = */ app_location_t::HOME, + + /*.m4_app_tag = portapack::spi_flash::image_tag_replay */ {'P', 'R', 'E', 'P'}, + /*.m4_app_offset = */ 0x00000000, // will be filled at compile time +}; +} diff --git a/firmware/application/apps/ui_remote.cpp b/firmware/application/external/remote/ui_remote.cpp similarity index 93% rename from firmware/application/apps/ui_remote.cpp rename to firmware/application/external/remote/ui_remote.cpp index ea4c7fd5..b4f7f650 100644 --- a/firmware/application/apps/ui_remote.cpp +++ b/firmware/application/external/remote/ui_remote.cpp @@ -20,7 +20,6 @@ */ #include "ui_remote.hpp" - #include "binder.hpp" #include "convert.hpp" #include "file_reader.hpp" @@ -34,11 +33,11 @@ #include "utility.hpp" #include "file_path.hpp" +namespace ui::external_app::remote { + using namespace portapack; namespace fs = std::filesystem; -namespace ui { - static constexpr uint8_t text_edit_max = 30; /* RemoteEntryModel **************************************/ @@ -309,9 +308,9 @@ void RemoteEntryEditView::load_path(std::filesystem::path&& path) { entry_.metadata = {transmitter_model.target_frequency(), 500'000}; } -/* RemoteView ********************************************/ +/* RemoteAppView ********************************************/ -RemoteView::RemoteView( +RemoteAppView::RemoteAppView( NavigationView& nav) : nav_{nav} { baseband::run_image(portapack::spi_flash::image_tag_replay); @@ -365,27 +364,27 @@ RemoteView::RemoteView( refresh_ui(); } -RemoteView::RemoteView(NavigationView& nav, fs::path path) - : RemoteView(nav) { +RemoteAppView::RemoteAppView(NavigationView& nav, fs::path path) + : RemoteAppView(nav) { load_remote(std::move(path)); refresh_ui(); } -RemoteView::~RemoteView() { +RemoteAppView::~RemoteAppView() { stop(); baseband::shutdown(); save_remote(/*show_error*/ false); } -void RemoteView::focus() { +void RemoteAppView::focus() { if (model_.entries.empty()) button_add.focus(); else buttons_[0]->focus(); } -void RemoteView::create_buttons() { +void RemoteAppView::create_buttons() { // Handler callbacks. auto handle_send = [this](RemoteButton& btn) { if (btn.entry()->path.empty()) @@ -420,7 +419,7 @@ void RemoteView::create_buttons() { } } -void RemoteView::reset_buttons() { +void RemoteAppView::reset_buttons() { // Whever the model's entries instance is invalidated, // all the pointers in the buttons will end up dangling. // TODO: This is pretty lame. Could maybe static alloc? @@ -428,7 +427,7 @@ void RemoteView::reset_buttons() { btn->set_entry(nullptr); } -void RemoteView::refresh_ui() { +void RemoteAppView::refresh_ui() { field_title.set_text(model_.name); field_filename.set_text(remote_path_.stem().string()); @@ -441,7 +440,7 @@ void RemoteView::refresh_ui() { } } -void RemoteView::add_button() { +void RemoteAppView::add_button() { if (model_.entries.size() >= max_buttons) return; @@ -454,7 +453,7 @@ void RemoteView::add_button() { set_needs_save(); } -void RemoteView::edit_button(RemoteButton& btn) { +void RemoteAppView::edit_button(RemoteButton& btn) { // Don't let replay thread read the model while editing. stop(); @@ -471,7 +470,7 @@ void RemoteView::edit_button(RemoteButton& btn) { }; } -void RemoteView::send_button(RemoteButton& btn) { +void RemoteAppView::send_button(RemoteButton& btn) { // TODO: If this is called while is_sending() == true, // it just stops and doesn't start the new button? @@ -510,14 +509,14 @@ void RemoteView::send_button(RemoteButton& btn) { }); } -void RemoteView::stop() { +void RemoteAppView::stop() { // This terminates the underlying chThread. replay_thread_.reset(); transmitter_model.disable(); ready_signal_ = false; } -void RemoteView::new_remote() { +void RemoteAppView::new_remote() { save_remote(); init_remote(); refresh_ui(); @@ -526,7 +525,7 @@ void RemoteView::new_remote() { set_dirty(); } -void RemoteView::open_remote() { +void RemoteAppView::open_remote() { auto open_view = nav_.push(".REM"); open_view->push_dir(remotes_dir); open_view->on_changed = [this](fs::path path) { @@ -536,7 +535,7 @@ void RemoteView::open_remote() { }; } -void RemoteView::init_remote() { +void RemoteAppView::init_remote() { model_ = {"", {}}; reset_buttons(); set_remote_path(next_filename_matching_pattern(remotes_dir / u"REMOTE_????.REM")); @@ -546,14 +545,14 @@ void RemoteView::init_remote() { show_error("Couldn't make new remote file."); } -bool RemoteView::load_remote(fs::path&& path) { +bool RemoteAppView::load_remote(fs::path&& path) { set_remote_path(std::move(path)); set_needs_save(false); reset_buttons(); return model_.load(remote_path_); } -void RemoteView::save_remote(bool show_errors) { +void RemoteAppView::save_remote(bool show_errors) { if (!needs_save_) return; @@ -564,7 +563,7 @@ void RemoteView::save_remote(bool show_errors) { set_needs_save(false); } -void RemoteView::rename_remote(const std::string& new_name) { +void RemoteAppView::rename_remote(const std::string& new_name) { auto folder = remote_path_.parent_path(); auto ext = remote_path_.extension(); auto new_path = folder / new_name + ext; @@ -581,7 +580,7 @@ void RemoteView::rename_remote(const std::string& new_name) { set_remote_path(std::move(new_path)); } -void RemoteView::handle_replay_thread_done(uint32_t return_code) { +void RemoteAppView::handle_replay_thread_done(uint32_t return_code) { if (return_code == ReplayThread::END_OF_FILE) { if (check_loop.value() && current_btn_) { send_button(*current_btn_); @@ -598,15 +597,15 @@ void RemoteView::handle_replay_thread_done(uint32_t return_code) { stop(); } -void RemoteView::set_remote_path(fs::path&& path) { +void RemoteAppView::set_remote_path(fs::path&& path) { // Unfortunately, have to keep these two in sync because // settings doesn't know about fs::path. remote_path_ = std::move(path); settings_.remote_path = remote_path_.string(); } -void RemoteView::show_error(const std::string& msg) const { +void RemoteAppView::show_error(const std::string& msg) const { nav_.display_modal("Error", msg); } -} /* namespace ui */ +} // namespace ui::external_app::remote diff --git a/firmware/application/apps/ui_remote.hpp b/firmware/application/external/remote/ui_remote.hpp similarity index 96% rename from firmware/application/apps/ui_remote.hpp rename to firmware/application/external/remote/ui_remote.hpp index 548f8a14..fa35102f 100644 --- a/firmware/application/apps/ui_remote.hpp +++ b/firmware/application/external/remote/ui_remote.hpp @@ -41,7 +41,7 @@ #include #include -namespace ui { +namespace ui::external_app::remote { /* Maps icon index to bitmap. */ class RemoteIcons { @@ -257,14 +257,14 @@ class RemoteEntryEditView : public View { }; /* App that allows for buttons to be bound to captures for playback. */ -class RemoteView : public View { +class RemoteAppView : public View { public: - RemoteView(NavigationView& nav); - RemoteView(NavigationView& nav, std::filesystem::path path); - ~RemoteView(); + RemoteAppView(NavigationView& nav); + RemoteAppView(NavigationView& nav, std::filesystem::path path); + ~RemoteAppView(); - RemoteView(const RemoteView&) = delete; - RemoteView& operator=(const RemoteView&) = delete; + RemoteAppView(const RemoteAppView&) = delete; + RemoteAppView& operator=(const RemoteAppView&) = delete; std::string title() const override { return "Remote"; }; void focus() override; @@ -385,4 +385,4 @@ class RemoteView : public View { }}; }; -} /* namespace ui */ +} // namespace ui::external_app::remote diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index a02ada90..8b3f9676 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -52,7 +52,6 @@ #include "ui_pocsag_tx.hpp" #include "ui_rds.hpp" #include "ui_recon.hpp" -#include "ui_remote.hpp" #include "ui_scanner.hpp" #include "ui_sd_over_usb.hpp" #include "ui_sd_wipe.hpp" @@ -126,7 +125,6 @@ const NavigationView::AppList NavigationView::appList = { {nullptr, "Transmit", HOME, Color::cyan(), &bitmap_icon_transmit, new ViewFactory()}, {"capture", "Capture", HOME, Color::red(), &bitmap_icon_capture, new ViewFactory()}, {"replay", "Replay", HOME, Color::green(), &bitmap_icon_replay, new ViewFactory()}, - {"remote", "Remote", HOME, ui::Color::green(), &bitmap_icon_remote, new ViewFactory()}, {"scanner", "Scanner", HOME, Color::green(), &bitmap_icon_scanner, new ViewFactory()}, {"microphone", "Microphone", HOME, Color::green(), &bitmap_icon_microphone, new ViewFactory()}, {"lookingglass", "Looking Glass", HOME, Color::green(), &bitmap_icon_looking, new ViewFactory()}, @@ -851,6 +849,7 @@ SystemMenuView::SystemMenuView(NavigationView& nav) void SystemMenuView::on_populate() { add_apps(nav_, *this, HOME); + addExternalItems(nav_, app_location_t::HOME, *this); add_item({"HackRF", Theme::getInstance()->fg_cyan->foreground, &bitmap_icon_hackrf, [this]() { hackrf_mode(nav_); }}); }