0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 14:21:25 +03:00

niw shows channel under freq if frequency is found in a channel

This commit is contained in:
OneOfEleven 2023-11-06 16:16:29 +00:00
parent be787babf2
commit 3779c5a36b
7 changed files with 90 additions and 47 deletions

View File

@ -82,7 +82,7 @@ ENABLE_TX_AUDIO_BAR := 0
# Side Button Menu 300 B # Side Button Menu 300 B
ENABLE_SIDE_BUTT_MENU := 0 ENABLE_SIDE_BUTT_MENU := 0
# Key Lock 400 B # Key Lock 400 B
ENABLE_KEYLOCK := 0 ENABLE_KEYLOCK := 1
ENABLE_PANADAPTER := 0 ENABLE_PANADAPTER := 0
#ENABLE_SINGLE_VFO_CHAN := 0 #ENABLE_SINGLE_VFO_CHAN := 0

View File

@ -32,11 +32,11 @@ const uint8_t BITMAP_POWERSAVE[8] =
const uint8_t BITMAP_TX[8] = const uint8_t BITMAP_TX[8] =
{ // "TX" { // "TX"
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b00000001, __extension__ 0b00000010,
__extension__ 0b00000001, __extension__ 0b00000010,
__extension__ 0b01111111, __extension__ 0b01111110,
__extension__ 0b00000001, __extension__ 0b00000010,
__extension__ 0b00000001, __extension__ 0b00000010,
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b00000000 __extension__ 0b00000000
}; };
@ -112,14 +112,15 @@ const uint8_t BITMAP_USB_C[8] =
}; };
#ifdef ENABLE_KEYLOCK #ifdef ENABLE_KEYLOCK
const uint8_t BITMAP_KEYLOCK[6] = const uint8_t BITMAP_KEYLOCK[7] =
{ // teeny weeny padlock symbol { // teeny weeny padlock symbol
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b01111100, __extension__ 0b01111100,
__extension__ 0b01000110, __extension__ 0b01000110,
__extension__ 0b01000101, __extension__ 0b01000101,
__extension__ 0b01000110, __extension__ 0b01000110,
__extension__ 0b01111100 __extension__ 0b01111100,
__extension__ 0b00000000
}; };
#endif #endif
@ -130,7 +131,7 @@ const uint8_t BITMAP_F_KEY[6] =
__extension__ 0b01111111, __extension__ 0b01111111,
__extension__ 0b00011011, __extension__ 0b00011011,
__extension__ 0b00011011, __extension__ 0b00011011,
__extension__ 0b00011011 __extension__ 0b00000011
}; };
#ifdef ENABLE_VOX #ifdef ENABLE_VOX
@ -178,22 +179,22 @@ const uint8_t BITMAP_F_KEY[6] =
const uint8_t BITMAP_VOX_SMALL[17] = const uint8_t BITMAP_VOX_SMALL[17] =
{ // "vox" { // "vox"
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b00000111, __extension__ 0b00001110,
__extension__ 0b00001000,
__extension__ 0b00010000, __extension__ 0b00010000,
__extension__ 0b00100000,
__extension__ 0b00010000,
__extension__ 0b00001110,
__extension__ 0b00000000,
__extension__ 0b00011100,
__extension__ 0b00100010,
__extension__ 0b00100010,
__extension__ 0b00011100,
__extension__ 0b00000000,
__extension__ 0b00100010,
__extension__ 0b00010100,
__extension__ 0b00001000, __extension__ 0b00001000,
__extension__ 0b00000111, __extension__ 0b00010100,
__extension__ 0b00000000, __extension__ 0b00100010
__extension__ 0b00001110,
__extension__ 0b00010001,
__extension__ 0b00010001,
__extension__ 0b00001110,
__extension__ 0b00000000,
__extension__ 0b00010001,
__extension__ 0b00001010,
__extension__ 0b00000100,
__extension__ 0b00001010,
__extension__ 0b00010001
}; };
#endif #endif
@ -231,34 +232,36 @@ const uint8_t BITMAP_F_KEY[6] =
}; };
#endif #endif
const uint8_t BITMAP_TDR_RUNNING[11] = const uint8_t BITMAP_TDR_RUNNING[12] =
{ // "DW" { // "DW"
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b01111111, __extension__ 0b01111110,
__extension__ 0b01000001, __extension__ 0b01000010,
__extension__ 0b01000001, __extension__ 0b01000010,
__extension__ 0b00111110, __extension__ 0b00111100,
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b01111111, __extension__ 0b01111110,
__extension__ 0b00100000, __extension__ 0b00100000,
__extension__ 0b00011000, __extension__ 0b00011000,
__extension__ 0b00100000, __extension__ 0b00100000,
__extension__ 0b01111111 __extension__ 0b01111110,
__extension__ 0b00000000
}; };
const uint8_t BITMAP_TDR_HOLDING[11] = const uint8_t BITMAP_TDR_HOLDING[12] =
{ // "--" .. DW on hold { // "--" .. DW on hold
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00000000, __extension__ 0b00000000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00001000, __extension__ 0b00010000,
__extension__ 0b00001000 __extension__ 0b00010000,
__extension__ 0b00000000
}; };
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE

View File

@ -13,7 +13,7 @@ extern const uint8_t BITMAP_BATTERY_LEVEL[17];
extern const uint8_t BITMAP_USB_C[8]; extern const uint8_t BITMAP_USB_C[8];
#ifdef ENABLE_KEYLOCK #ifdef ENABLE_KEYLOCK
extern const uint8_t BITMAP_KEYLOCK[6]; extern const uint8_t BITMAP_KEYLOCK[7];
#endif #endif
extern const uint8_t BITMAP_F_KEY[6]; extern const uint8_t BITMAP_F_KEY[6];
@ -29,8 +29,8 @@ extern const uint8_t BITMAP_F_KEY[6];
extern const uint8_t BITMAP_XB[11]; extern const uint8_t BITMAP_XB[11];
#endif #endif
extern const uint8_t BITMAP_TDR_RUNNING[11]; extern const uint8_t BITMAP_TDR_RUNNING[12];
extern const uint8_t BITMAP_TDR_HOLDING[11]; extern const uint8_t BITMAP_TDR_HOLDING[12];
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
extern const uint8_t BITMAP_VOICE_PROMPT[7]; extern const uint8_t BITMAP_VOICE_PROMPT[7];

Binary file not shown.

Binary file not shown.

View File

@ -696,9 +696,9 @@ void UI_DisplayMain(void)
// name // name
#ifdef ENABLE_SMALL_BOLD #ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold(str, x + 4, 0, line); UI_PrintStringSmallBold(str, x + 4, 0, line + 0);
#else #else
UI_PrintStringSmall(str, x + 4, 0, line); UI_PrintStringSmall(str, x + 4, 0, line + 0);
#endif #endif
// frequency // frequency
@ -718,13 +718,35 @@ void UI_DisplayMain(void)
#ifdef ENABLE_BIG_FREQ #ifdef ENABLE_BIG_FREQ
big_freq(frequency, x, line); big_freq(frequency, x, line);
#else #else
// show the frequency in the main font
const unsigned int chan = g_vfo_info[vfo_num].freq_in_channel;
sprintf(str, "%03u.%05u", frequency / 100000, frequency % 100000); sprintf(str, "%03u.%05u", frequency / 100000, frequency % 100000);
#ifdef ENABLE_TRIM_TRAILING_ZEROS #ifdef ENABLE_TRIM_TRAILING_ZEROS
NUMBER_trim_trailing_zeros(str); NUMBER_trim_trailing_zeros(str);
#endif #endif
UI_PrintString(str, x, 0, line, 8);
//g_vfo_info[vfo_num].freq_in_channel = SETTINGS_find_channel(frequency);
if (chan <= USER_CHANNEL_LAST)
{ // the frequency has a channel - show the channel name below the frequency
// frequency
#ifdef ENABLE_SMALL_BOLD
UI_PrintStringSmallBold(str, x + 4, 0, line + 0);
#else
UI_PrintStringSmall(str, x + 4, 0, line + 0);
#endif
// name
SETTINGS_fetch_channel_name(str, chan);
if (str[0] == 0)
sprintf(str, "CH-%03u", 1 + chan);
UI_PrintStringSmall(str, x + 4, 0, line + 1);
}
else
{ // show the frequency in the main font
UI_PrintString(str, x, 0, line, 8);
}
#endif #endif
} }

View File

@ -32,6 +32,14 @@
#include "ui/ui.h" #include "ui/ui.h"
#include "ui/status.h" #include "ui/status.h"
void invert_pixels(void *p, const unsigned int size)
{
unsigned int i;
uint8_t *p8 = (uint8_t *)p;
for (i = 0; i < size; i++)
*p8++ ^= 0xff;
}
void UI_DisplayStatus(const bool test_display) void UI_DisplayStatus(const bool test_display)
{ {
uint8_t *line = g_status_line; uint8_t *line = g_status_line;
@ -47,6 +55,7 @@ void UI_DisplayStatus(const bool test_display)
if (g_current_function == FUNCTION_TRANSMIT) if (g_current_function == FUNCTION_TRANSMIT)
{ {
memcpy(line + x, BITMAP_TX, sizeof(BITMAP_TX)); memcpy(line + x, BITMAP_TX, sizeof(BITMAP_TX));
invert_pixels(line + x, sizeof(BITMAP_TX));
} }
else else
if (g_current_function == FUNCTION_RECEIVE || if (g_current_function == FUNCTION_RECEIVE ||
@ -144,9 +153,14 @@ void UI_DisplayStatus(const bool test_display)
} }
if (dw_running) if (dw_running)
{
memcpy(line + x, BITMAP_TDR_RUNNING, sizeof(BITMAP_TDR_RUNNING)); memcpy(line + x, BITMAP_TDR_RUNNING, sizeof(BITMAP_TDR_RUNNING));
invert_pixels(line + x, sizeof(BITMAP_TDR_RUNNING));
}
else else
{
memcpy(line + x, BITMAP_TDR_HOLDING, sizeof(BITMAP_TDR_HOLDING)); memcpy(line + x, BITMAP_TDR_HOLDING, sizeof(BITMAP_TDR_HOLDING));
}
x += sizeof(BITMAP_TDR_RUNNING) + 1; x += sizeof(BITMAP_TDR_RUNNING) + 1;
} }
@ -169,6 +183,8 @@ void UI_DisplayStatus(const bool test_display)
if (g_eeprom.config.setting.vox_enabled || test_display) if (g_eeprom.config.setting.vox_enabled || test_display)
{ {
memcpy(line + x, g_vox_audio_detected ? BITMAP_VOX : BITMAP_VOX_SMALL, sizeof(BITMAP_VOX)); memcpy(line + x, g_vox_audio_detected ? BITMAP_VOX : BITMAP_VOX_SMALL, sizeof(BITMAP_VOX));
// if (g_vox_audio_detected)
// invert_pixels(line + x, sizeof(BITMAP_VOX));
x += sizeof(BITMAP_VOX) + 1; x += sizeof(BITMAP_VOX) + 1;
} }
#endif #endif
@ -178,6 +194,7 @@ void UI_DisplayStatus(const bool test_display)
if (g_eeprom.config.setting.key_lock || test_display) if (g_eeprom.config.setting.key_lock || test_display)
{ {
memcpy(line + x, BITMAP_KEYLOCK, sizeof(BITMAP_KEYLOCK)); memcpy(line + x, BITMAP_KEYLOCK, sizeof(BITMAP_KEYLOCK));
invert_pixels(line + x, sizeof(BITMAP_KEYLOCK));
x += sizeof(BITMAP_KEYLOCK) + 1; x += sizeof(BITMAP_KEYLOCK) + 1;
} }
else else
@ -185,6 +202,7 @@ void UI_DisplayStatus(const bool test_display)
if (g_fkey_pressed) if (g_fkey_pressed)
{ {
memcpy(line + x, BITMAP_F_KEY, sizeof(BITMAP_F_KEY)); memcpy(line + x, BITMAP_F_KEY, sizeof(BITMAP_F_KEY));
// invert_pixels(line + x, sizeof(BITMAP_F_KEY));
x += sizeof(BITMAP_F_KEY); x += sizeof(BITMAP_F_KEY);
} }
x++; x++;