From 1b7ef4212d3edbb2b8b8e02273109f97be03bcc8 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 22 Mar 2019 10:14:34 -0700 Subject: [PATCH] PortaPack: Show RX/TX "waves" when radio is operating. --- firmware/common/ui_portapack.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/firmware/common/ui_portapack.c b/firmware/common/ui_portapack.c index ed1733ed..d9dc90da 100644 --- a/firmware/common/ui_portapack.c +++ b/firmware/common/ui_portapack.c @@ -242,12 +242,28 @@ static const ui_bitmap_t bitmap_wire_24 = { { 24, 24 }, bitmap_wire_24_data }; -static const uint8_t bitmap_waves_data[] = { - 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x30, 0x06, 0x30, 0x06, 0x30, 0x06, 0x60, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x60, 0x0c, 0x30, 0x06, 0x30, 0x06, 0x30, 0x06, 0x00, 0x06, 0x00, 0x03, 0x00, 0x03 +static const uint8_t bitmap_blank_24_data[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -__attribute__((unused)) static const ui_bitmap_t bitmap_waves = { - { 16, 20 }, bitmap_waves_data +static const ui_bitmap_t bitmap_blank_24 = { + { 24, 24 }, bitmap_blank_24_data +}; + +static const uint8_t bitmap_waves_rx_data[] = { + 0xc0, 0x00, 0x60, 0x00, 0x70, 0x06, 0x30, 0x07, 0x38, 0x03, 0x98, 0x33, 0x98, 0x39, 0x98, 0x19, 0xcc, 0x18, 0xcc, 0x0c, 0xcc, 0x0c, 0xcc, 0x0c, 0xcc, 0x0c, 0xcc, 0x0c, 0xcc, 0x0c, 0xcc, 0x18, 0x98, 0x19, 0x98, 0x39, 0x98, 0x33, 0x38, 0x03, 0x30, 0x07, 0x70, 0x06, 0x60, 0x00, 0xc0, 0x00 +}; + +static const ui_bitmap_t bitmap_waves_rx = { + { 16, 24 }, bitmap_waves_rx_data +}; + +static const uint8_t bitmap_waves_tx_data[] = { + 0x00, 0x03, 0x00, 0x06, 0x60, 0x0e, 0xe0, 0x0c, 0xc0, 0x1c, 0xcc, 0x19, 0x9c, 0x19, 0x98, 0x19, 0x18, 0x33, 0x30, 0x33, 0x30, 0x33, 0x30, 0x33, 0x30, 0x33, 0x30, 0x33, 0x30, 0x33, 0x18, 0x33, 0x98, 0x19, 0x9c, 0x19, 0xcc, 0x19, 0xc0, 0x1c, 0xe0, 0x0c, 0x60, 0x0e, 0x00, 0x06, 0x00, 0x03 +}; + +static const ui_bitmap_t bitmap_waves_tx = { + { 16, 24 }, bitmap_waves_tx_data }; __attribute__((unused)) static ui_color_t portapack_color_rgb( @@ -317,6 +333,7 @@ static draw_list_t radio_draw_list[] = { { &bitmap_amp_rx, { 32, 288 } }, { &bitmap_wire_8, { 43, 312 } }, { &bitmap_oscillator, { 208, 288 } }, + { &bitmap_blank_24, { 60, 60 } }, }; typedef enum { @@ -329,6 +346,7 @@ typedef enum { RADIO_DRAW_LIST_ITEM_BB_FILTER = 12, RADIO_DRAW_LIST_ITEM_BB_VGA_AMP = 14, RADIO_DRAW_LIST_ITEM_CLOCK = 16, + RADIO_DRAW_LIST_ITEM_WAVES = 17, } radio_draw_list_item_t; static ui_point_t portapack_ui_label_point(const radio_draw_list_item_t item) { @@ -437,6 +455,7 @@ static void portapack_ui_set_sample_rate(uint32_t sample_rate) { static void portapack_ui_set_direction(const rf_path_direction_t direction) { switch(direction) { case RF_PATH_DIRECTION_TX: + portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_WAVES, &bitmap_waves_tx); portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_RF_AMP, portapack_lna_on ? &bitmap_amp_tx : &bitmap_wire_24); portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_BB_LNA_AMP, &bitmap_amp_tx); portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_BB_VGA_AMP, &bitmap_wire_24); @@ -444,6 +463,7 @@ static void portapack_ui_set_direction(const rf_path_direction_t direction) { break; case RF_PATH_DIRECTION_RX: + portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_WAVES, &bitmap_waves_rx); portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_RF_AMP, portapack_lna_on ? &bitmap_amp_rx : &bitmap_wire_24); portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_BB_LNA_AMP, &bitmap_amp_rx); portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_BB_VGA_AMP, &bitmap_amp_rx); @@ -451,6 +471,7 @@ static void portapack_ui_set_direction(const rf_path_direction_t direction) { case RF_PATH_DIRECTION_OFF: default: + portapack_radio_path_item_update(RADIO_DRAW_LIST_ITEM_WAVES, &bitmap_blank_24); break; }