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

Updated font and F-LOCK menu option

This commit is contained in:
OneOfEleven 2023-10-18 13:00:57 +01:00
parent bf7a837485
commit 2bd8db1714
10 changed files with 230 additions and 231 deletions

View File

@ -119,7 +119,8 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
case MENU_FREQ_LOCK:
*pMin = 0;
*pMax = ARRAY_SIZE(g_sub_menu_freq_lock) - 1;
// *pMax = ARRAY_SIZE(g_sub_menu_freq_lock) - 1;
*pMax = FREQ_LOCK_LAST - 1;
break;
case MENU_MEM_DISP:

View File

@ -725,11 +725,7 @@ void BOARD_EEPROM_load(void)
// 0F40..0F47
EEPROM_ReadBuffer(0x0F40, Data, 8);
#ifdef ENABLE_TX_UNLOCK
g_setting_freq_lock = (Data[0] < 7) ? Data[0] : FREQ_LOCK_NORMAL;
#else
g_setting_freq_lock = (Data[0] < 6) ? Data[0] : FREQ_LOCK_NORMAL;
#endif
g_setting_freq_lock = (Data[0] < FREQ_LOCK_LAST) ? Data[0] : FREQ_LOCK_NORMAL;
g_setting_350_tx_enable = (Data[1] < 2) ? Data[1] : false; // was true
#ifdef ENABLE_KILL_REVIVE
g_setting_radio_disabled = (Data[2] < 2) ? Data[2] : false;

Binary file not shown.

Binary file not shown.

5
font.c
View File

@ -16,7 +16,6 @@
#include "font.h"
//const uint8_t g_font_big[95][16] =
const uint8_t g_font_big[95][15] =
{
#if 0
@ -114,7 +113,7 @@ const uint8_t g_font_big[95][15] =
{0x00, 0x80, 0x80, 0xF0, 0x78, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x10, 0x10}, // '{'
{0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x00}, // '|'
{0x00, 0x08, 0x08, 0x78, 0xF0, 0x80, 0x80, 0x00, 0x00, 0x10, 0x10, 0x1F, 0x0F, 0x00, 0x00}, // '}'
{0x10, 0x18, 0x08, 0x18, 0x10, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // '~'
{0x10 << 4, 0x18 << 4, 0x08 << 4, 0x18 << 4, 0x10 << 4, 0x18 << 4, 0x08 << 4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // '~'
#else
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0xFC, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x00},
@ -210,7 +209,7 @@ const uint8_t g_font_big[95][15] =
{0x00, 0x00, 0x40, 0xF8, 0xBC, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0F, 0x08, 0x08},
{0x00, 0x00, 0x00, 0xBC, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00},
{0x00, 0x04, 0x04, 0xBC, 0xF8, 0x40, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0F, 0x07, 0x00, 0x00},
{0x08, 0x0C, 0x04, 0x0C, 0x08, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
{0x08 << 4, 0x0C << 4, 0x04 << 4, 0x0C << 4, 0x08 << 4, 0x0C << 4, 0x04 << 4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
#endif
};

1
font.h
View File

@ -19,7 +19,6 @@
#include <stdint.h>
//extern const uint8_t g_font_big[95][16];
extern const uint8_t g_font_big[95][15];
extern const uint8_t g_font_big_digits[11][26];
//extern const uint8_t g_font_small_digits[11][7];

View File

@ -201,6 +201,11 @@ int TX_freq_check(const uint32_t Frequency)
return 0;
break;
case FREQ_LOCK_446:
if (Frequency >= 446.00625 && Frequency <= 446.19375)
return 0;
break;
#ifdef ENABLE_TX_UNLOCK
case FREQ_LOCK_TX_UNLOCK:
return 0;

View File

@ -38,9 +38,11 @@ enum {
FREQ_LOCK_GB,
FREQ_LOCK_430,
FREQ_LOCK_438,
FREQ_LOCK_446,
#ifdef ENABLE_TX_UNLOCK
FREQ_LOCK_TX_UNLOCK
FREQ_LOCK_TX_UNLOCK,
#endif
FREQ_LOCK_LAST
};
enum {

View File

@ -296,29 +296,6 @@ const char g_sub_menu_RESET[2][4] =
"ALL"
};
#ifdef ENABLE_TX_UNLOCK
const char g_sub_menu_freq_lock[7][9] =
{
"NORMAL",
"FCC",
"CE",
"GB",
"430 MHz",
"438 MHz",
"UNLOCKED"
};
#else
const char g_sub_menu_freq_lock[6][8] =
{
"NORMAL",
"FCC",
"CE",
"GB",
"430 MHz",
"438 MHz"
};
#endif
const char g_sub_menu_backlight[8][7] =
{
"OFF",
@ -1066,10 +1043,35 @@ void UI_DisplayMenu(void)
break;
case MENU_FREQ_LOCK:
if (g_sub_menu_selection == 0)
strcpy(String, "136 ~ 174\n400 ~ 470\n+ other\noptions");
else
strcpy(String, g_sub_menu_freq_lock[g_sub_menu_selection]);
switch (g_sub_menu_selection)
{
case FREQ_LOCK_NORMAL:
strcpy(String, "136~174\n400~470\n+ others");
break;
case FREQ_LOCK_FCC:
strcpy(String, "FCC HAM\n144~148\n420~450");
break;
case FREQ_LOCK_CE:
strcpy(String, "CE HAM\n144~146\n430~440");
break;
case FREQ_LOCK_GB:
strcpy(String, "GB HAM\n144~148\n430~440");
break;
case FREQ_LOCK_430:
strcpy(String, "136~174\n400~430");
break;
case FREQ_LOCK_438:
strcpy(String, "136~174\n400~438");
break;
case FREQ_LOCK_446:
strcpy(String, "446.00625\n~\n446.19375");
break;
#ifdef ENABLE_TX_UNLOCK
case FREQ_LOCK_TX_UNLOCK:
sprintf(String, "UNLOCKED\n%u ~ %u", BX4819_BAND1.lower / 100000, BX4819_BAND2.upper / 100000);
break;
#endif
}
break;
#ifdef ENABLE_F_CAL_MENU

View File

@ -174,11 +174,6 @@ extern const char g_sub_menu_PTT_ID[5][15];
extern const char g_sub_menu_pwr_on_msg[4][14];
extern const char g_sub_MENU_ROGER_MODE_mode[3][16];
extern const char g_sub_menu_RESET[2][4];
#ifdef ENABLE_TX_UNLOCK
extern const char g_sub_menu_freq_lock[7][9];
#else
extern const char g_sub_menu_freq_lock[6][8];
#endif
extern const char g_sub_menu_backlight[8][7];
extern const char g_sub_menu_rx_tx[4][6];
#ifdef ENABLE_AM_FIX_TEST1