0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00
This commit is contained in:
OneOfEleven 2023-11-25 12:17:10 +00:00
parent 010721deac
commit 59a9db1c4f
5 changed files with 231 additions and 197 deletions

View File

@ -99,7 +99,7 @@ ENABLE_SIDE_BUTT_MENU := 1 enable menu option for configuring t
ENABLE_KEYLOCK := 1 enable keylock menu option + keylock code ENABLE_KEYLOCK := 1 enable keylock menu option + keylock code
ENABLE_PANADAPTER := 1 centered on the selected VFO RX frequency, only shows if dual-watch is disabled ENABLE_PANADAPTER := 1 centered on the selected VFO RX frequency, only shows if dual-watch is disabled
ENABLE_PANADAPTER_PEAK_FREQ := 0 show the peak panadapter frequency ENABLE_PANADAPTER_PEAK_FREQ := 0 show the peak panadapter frequency
#ENABLE_SINGLE_VFO_CHAN := 0 not yet implemented - single VFO on display when possible #ENABLE_SINGLE_VFO_CHAN := 0 not yet implemented
``` ```
# New/modified function keys # New/modified function keys
@ -228,6 +228,8 @@ You may obtain a copy of the License at
<img src="/images/image4.png" width=300 /> <img src="/images/image4.png" width=300 />
</p> </p>
<img src="/images/UV_K5_8_antenna.png" />
<video src="https://github.com/OneOfEleven/uv-k5-firmware-custom/assets/51590168/921162a7-e9f2-4023-b4d5-526567f8b989"></video> <video src="https://github.com/OneOfEleven/uv-k5-firmware-custom/assets/51590168/921162a7-e9f2-4023-b4d5-526567f8b989"></video>
# WARNING if trying to use K5/K6 to TX out of band .. # WARNING if trying to use K5/K6 to TX out of band ..

Binary file not shown.

Binary file not shown.

BIN
images/UV_K5_8_antenna.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

View File

@ -497,6 +497,23 @@ void big_freq(const uint32_t frequency, const unsigned int x, const unsigned int
} }
#endif #endif
#ifdef ENABLE_SINGLE_VFO_CHAN
void UI_DisplayMainSingle(void)
{
int vfo_num = g_eeprom.config.setting.tx_vfo_num;
const unsigned int scrn_chan = g_eeprom.config.setting.indices.vfo[vfo_num].screen;
uint8_t *p_line = g_frame_buffer[0];
unsigned int mode = 0;
unsigned int state;
char str[22];
}
#endif
void UI_DisplayMain(void) void UI_DisplayMain(void)
{ {
#if !defined(ENABLE_BIG_FREQ) && defined(ENABLE_SMALLEST_FONT) #if !defined(ENABLE_BIG_FREQ) && defined(ENABLE_SMALLEST_FONT)
@ -506,6 +523,9 @@ void UI_DisplayMain(void)
const unsigned int line1 = 4; const unsigned int line1 = 4;
int main_vfo_num = g_eeprom.config.setting.tx_vfo_num; int main_vfo_num = g_eeprom.config.setting.tx_vfo_num;
int current_vfo_num = g_eeprom.config.setting.tx_vfo_num; int current_vfo_num = g_eeprom.config.setting.tx_vfo_num;
#ifdef ENABLE_SINGLE_VFO_CHAN
bool single_vfo_chan = false;
#endif
char str[22]; char str[22];
int vfo_num; int vfo_num;
@ -554,9 +574,18 @@ void UI_DisplayMain(void)
#ifdef ENABLE_PANADAPTER #ifdef ENABLE_PANADAPTER
if (g_eeprom.config.setting.panadapter && g_panadapter_enabled && single_vfo >= 0) if (g_eeprom.config.setting.panadapter && g_panadapter_enabled && single_vfo >= 0)
pan_enabled = true; pan_enabled = true;
#ifndef ENABLE_SINGLE_VFO_CHAN
else else
single_vfo = -1; single_vfo = -1;
#endif #endif
#endif
#ifdef ENABLE_SINGLE_VFO_CHAN
single_vfo_chan = (single_vfo >= 0 && pan_enabled) ? true : false;
if (single_vfo_chan)
UI_DisplayMainSingle();
#endif
for (vfo_num = 0; vfo_num < 2; vfo_num++) for (vfo_num = 0; vfo_num < 2; vfo_num++)
{ {
@ -658,7 +687,6 @@ void UI_DisplayMain(void)
if (g_current_function == FUNCTION_TRANSMIT) if (g_current_function == FUNCTION_TRANSMIT)
{ // transmitting { // transmitting
#ifdef ENABLE_ALARM #ifdef ENABLE_ALARM
if (g_alarm_state == ALARM_STATE_ALARM) if (g_alarm_state == ALARM_STATE_ALARM)
mode = 1; mode = 1;
@ -669,10 +697,11 @@ void UI_DisplayMain(void)
if (current_vfo_num == vfo_num) if (current_vfo_num == vfo_num)
{ // show the TX symbol { // show the TX symbol
mode = 1; mode = 1;
const int x = 14;
#ifdef ENABLE_SMALL_BOLD #ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold("TX", 14, 0, line); UI_PrintStringSmallBold("TX", x, 0, line);
#else #else
UI_PrintStringSmall("TX", 14, 0, line); UI_PrintStringSmall("TX", x, 0, line);
#endif #endif
} }
} }
@ -682,10 +711,11 @@ void UI_DisplayMain(void)
mode = 2; mode = 2;
if ((g_current_function == FUNCTION_RECEIVE && g_squelch_open) && g_rx_vfo_num == vfo_num) if ((g_current_function == FUNCTION_RECEIVE && g_squelch_open) && g_rx_vfo_num == vfo_num)
{ {
const int x = 14;
#ifdef ENABLE_SMALL_BOLD #ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold("RX", 14, 0, line); UI_PrintStringSmallBold("RX", x, 0, line);
#else #else
UI_PrintStringSmall("RX", 14, 0, line); UI_PrintStringSmall("RX", x, 0, line);
#endif #endif
} }
} }
@ -712,6 +742,7 @@ void UI_DisplayMain(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
else else
{ {
const int x = 7;
if (g_input_box_index == 0 || g_eeprom.config.setting.tx_vfo_num != vfo_num) if (g_input_box_index == 0 || g_eeprom.config.setting.tx_vfo_num != vfo_num)
{ // channel number { // channel number
sprintf(str, "N%u", 1 + scrn_chan - NOAA_CHANNEL_FIRST); sprintf(str, "N%u", 1 + scrn_chan - NOAA_CHANNEL_FIRST);
@ -720,7 +751,7 @@ void UI_DisplayMain(void)
{ // user entering channel number { // user entering channel number
sprintf(str, "N%u%u", '0' + g_input_box[0], '0' + g_input_box[1]); sprintf(str, "N%u%u", '0' + g_input_box[0], '0' + g_input_box[1]);
} }
UI_PrintStringSmall(str, 7, 0, line + 1); UI_PrintStringSmall(str, x, 0, line + 1);
} }
#endif #endif
@ -737,24 +768,25 @@ void UI_DisplayMain(void)
} }
#endif #endif
{
const unsigned int x = 32;
if (state != VFO_STATE_NORMAL) if (state != VFO_STATE_NORMAL)
{ {
const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALARM", "VOLT HIGH"}; const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALARM", "VOLT HIGH"};
if (state < ARRAY_SIZE(state_list)) if (state < ARRAY_SIZE(state_list))
UI_PrintString(state_list[state], 31, 0, line, 8); UI_PrintString(state_list[state], x - 1, 0, line, 8);
} }
else else
if (g_input_box_index > 0 && IS_FREQ_CHANNEL(scrn_chan) && g_eeprom.config.setting.tx_vfo_num == vfo_num) if (g_input_box_index > 0 && IS_FREQ_CHANNEL(scrn_chan) && g_eeprom.config.setting.tx_vfo_num == vfo_num)
{ // user is entering a frequency { // user is entering a frequency
// UI_DisplayFrequencyBig(g_input_box, 32, line, true, false, 6); // UI_DisplayFrequencyBig(g_input_box, x, line, true, false, 6);
// UI_DisplayFrequencyBig(g_input_box, 32, line, true, false, 7); // UI_DisplayFrequencyBig(g_input_box, x, line, true, false, 7);
UI_DisplayFrequency(g_input_box, 32, line, true, 8); UI_DisplayFrequency(g_input_box, x, line, true, 8);
// g_center_line = CENTER_LINE_IN_USE; // g_center_line = CENTER_LINE_IN_USE;
} }
else else
{ {
const unsigned int x = 32;
uint32_t frequency = g_vfo_info[vfo_num].p_rx->frequency; uint32_t frequency = g_vfo_info[vfo_num].p_rx->frequency;
if (g_current_function == FUNCTION_TRANSMIT) if (g_current_function == FUNCTION_TRANSMIT)
@ -797,7 +829,6 @@ void UI_DisplayMain(void)
SETTINGS_fetch_channel_name(str, scrn_chan); SETTINGS_fetch_channel_name(str, scrn_chan);
if (str[0] == 0) if (str[0] == 0)
{ // no channel name, use channel number { // no channel name, use channel number
// sprintf(str, "CH-%03u", 1 + scrn_chan);
sprintf(str, "CH-%u", 1 + scrn_chan); sprintf(str, "CH-%u", 1 + scrn_chan);
} }
@ -949,6 +980,7 @@ void UI_DisplayMain(void)
} }
#endif #endif
} }
}
// ************ // ************