mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 06:11:24 +03:00
Added extra MENU-MDF option (NAM+FRE)
This commit is contained in:
parent
1e3368ac2e
commit
b1399c8073
4
Makefile
4
Makefile
@ -85,10 +85,12 @@ SIZE = arm-none-eabi-size
|
||||
#GIT_HASH := $(shell git rev-parse --short HEAD)
|
||||
|
||||
ASFLAGS = -mcpu=cortex-m0
|
||||
CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD
|
||||
CFLAGS = -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD -fdata-sections -ffunction-sections
|
||||
CFLAGS += -DPRINTF_INCLUDE_CONFIG_H
|
||||
#CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
|
||||
|
||||
LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld
|
||||
#LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-gc-sections,-T,firmware.ld
|
||||
|
||||
# compilation options
|
||||
CFLAGS += -DDISABLE_NOAA
|
||||
|
26
app/menu.c
26
app/menu.c
@ -127,6 +127,7 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
|
||||
*pMin = 0;
|
||||
*pMax = 9;
|
||||
break;
|
||||
|
||||
case MENU_STEP:
|
||||
if (gTxVfo->Band == BAND2_108MHz)
|
||||
{
|
||||
@ -134,12 +135,24 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
|
||||
*pMax = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
// Fallthrough
|
||||
|
||||
case MENU_ABR:
|
||||
case MENU_F_LOCK:
|
||||
*pMin = 0;
|
||||
*pMax = 5;
|
||||
break;
|
||||
|
||||
case MENU_MDF:
|
||||
#ifdef CHAN_NAME_FREQ
|
||||
*pMin = 0;
|
||||
*pMax = 3;
|
||||
break;
|
||||
#endif
|
||||
|
||||
// Fallthrough
|
||||
|
||||
case MENU_TXP:
|
||||
case MENU_SFT_D:
|
||||
case MENU_TDR:
|
||||
@ -148,22 +161,24 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
|
||||
case MENU_VOICE:
|
||||
#endif
|
||||
case MENU_SC_REV:
|
||||
case MENU_MDF:
|
||||
case MENU_PONMSG:
|
||||
case MENU_ROGER:
|
||||
*pMin = 0;
|
||||
*pMax = 2;
|
||||
break;
|
||||
|
||||
case MENU_R_DCS:
|
||||
case MENU_T_DCS:
|
||||
*pMin = 0;
|
||||
*pMax = 208;
|
||||
break;
|
||||
|
||||
case MENU_R_CTCS:
|
||||
case MENU_T_CTCS:
|
||||
*pMin = 0;
|
||||
*pMax = 50;
|
||||
break;
|
||||
|
||||
case MENU_W_N:
|
||||
case MENU_BCL:
|
||||
case MENU_BEEP:
|
||||
@ -189,6 +204,7 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
|
||||
*pMin = 0;
|
||||
*pMax = 1;
|
||||
break;
|
||||
|
||||
case MENU_SCR:
|
||||
case MENU_VOX:
|
||||
case MENU_TOT:
|
||||
@ -196,6 +212,7 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
|
||||
*pMin = 0;
|
||||
*pMax = 10;
|
||||
break;
|
||||
|
||||
case MENU_MEM_CH:
|
||||
case MENU_1_CALL:
|
||||
case MENU_SLIST1:
|
||||
@ -204,32 +221,39 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
|
||||
*pMin = 0;
|
||||
*pMax = 199;
|
||||
break;
|
||||
|
||||
case MENU_SAVE:
|
||||
case MENU_MIC:
|
||||
*pMin = 0;
|
||||
*pMax = 4;
|
||||
break;
|
||||
|
||||
case MENU_S_LIST:
|
||||
*pMin = 1;
|
||||
*pMax = 2;
|
||||
break;
|
||||
|
||||
case MENU_D_RSP:
|
||||
case MENU_PTT_ID:
|
||||
*pMin = 0;
|
||||
*pMax = 3;
|
||||
break;
|
||||
|
||||
case MENU_D_HOLD:
|
||||
*pMin = 5;
|
||||
*pMax = 60;
|
||||
break;
|
||||
|
||||
case MENU_D_PRE:
|
||||
*pMin = 3;
|
||||
*pMax = 99;
|
||||
break;
|
||||
|
||||
case MENU_D_LIST:
|
||||
*pMin = 1;
|
||||
*pMax = 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
6
board.c
6
board.c
@ -363,7 +363,11 @@ void BOARD_EEPROM_Init(void)
|
||||
|
||||
// 0E78..0E7F
|
||||
EEPROM_ReadBuffer(0x0E78, Data, 8);
|
||||
gEeprom.CHANNEL_DISPLAY_MODE = (Data[1] < 3) ? Data[1] : MDF_FREQUENCY;
|
||||
#ifndef CHAN_NAME_FREQ
|
||||
gEeprom.CHANNEL_DISPLAY_MODE = (Data[1] < 3) ? Data[1] : MDF_FREQUENCY;
|
||||
#else
|
||||
gEeprom.CHANNEL_DISPLAY_MODE = (Data[1] < 4) ? Data[1] : MDF_FREQUENCY;
|
||||
#endif
|
||||
gEeprom.CROSS_BAND_RX_TX = (Data[2] < 3) ? Data[2] : CROSS_BAND_OFF;
|
||||
gEeprom.BATTERY_SAVE = (Data[3] < 5) ? Data[3] : 4;
|
||||
gEeprom.DUAL_WATCH = (Data[4] < 3) ? Data[4] : DUAL_WATCH_CHAN_A;
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
213
font.c
213
font.c
@ -141,7 +141,219 @@ const uint8_t gFontSmallDigits[11][7] = {
|
||||
{ 0x00, 0x46, 0x49, 0x49, 0x49, 0x29, 0x1E },
|
||||
{ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00 },
|
||||
};
|
||||
/*
|
||||
const uint64_t gFont8x8[16 * 6] =
|
||||
{
|
||||
0x0000000000000000, // 'space'
|
||||
0x0808080800080000, // '!'
|
||||
0x2828000000000000, // '"'
|
||||
0x00287C287C280000, // '#'
|
||||
0x081E281C0A3C0800, // '$'
|
||||
0x6094681629060000, // '%'
|
||||
0x1C20201926190000, // '&'
|
||||
0x0808000000000000, // '''
|
||||
0x0810202010080000, // '('
|
||||
0x1008040408100000, // ')'
|
||||
0x2A1C3E1C2A000000, // '*'
|
||||
0x0008083E08080000, // '+'
|
||||
0x0000000000081000, // ','
|
||||
0x0000003C00000000, // '-'
|
||||
0x0000000000080000, // '.'
|
||||
0x0204081020400000, // '/'
|
||||
|
||||
0x1824424224180000, // '0'
|
||||
0x08180808081C0000, // '1'
|
||||
0x3C420418207E0000, // '2'
|
||||
0x3C420418423C0000, // '3'
|
||||
0x081828487C080000, // '4'
|
||||
0x7E407C02423C0000, // '5'
|
||||
0x3C407C42423C0000, // '6'
|
||||
0x7E04081020400000, // '7'
|
||||
0x3C423C42423C0000, // '8'
|
||||
0x3C42423E023C0000, // '9'
|
||||
0x0000080000080000, // ':'
|
||||
0x0000080000081000, // ';'
|
||||
0x0006186018060000, // '<'
|
||||
0x00007E007E000000, // '='
|
||||
0x0060180618600000, // '>'
|
||||
0x3844041800100000, // '?'
|
||||
|
||||
0x003C449C945C201C, // '@'
|
||||
0x1818243C42420000, // 'A'
|
||||
0x7844784444780000, // 'B'
|
||||
0x3844808044380000, // 'C'
|
||||
0x7844444444780000, // 'D'
|
||||
0x7C407840407C0000, // 'E'
|
||||
0x7C40784040400000, // 'F'
|
||||
0x3844809C44380000, // 'G'
|
||||
0x42427E4242420000, // 'H'
|
||||
0x3E080808083E0000, // 'I'
|
||||
0x1C04040444380000, // 'J'
|
||||
0x4448507048440000, // 'K'
|
||||
0x40404040407E0000, // 'L'
|
||||
0x4163554941410000, // 'M'
|
||||
0x4262524A46420000, // 'N'
|
||||
0x1C222222221C0000, // 'O'
|
||||
|
||||
0x7844784040400000, // 'P'
|
||||
0x1C222222221C0200, // 'Q'
|
||||
0x7844785048440000, // 'R'
|
||||
0x1C22100C221C0000, // 'S'
|
||||
0x7F08080808080000, // 'T'
|
||||
0x42424242423C0000, // 'U'
|
||||
0x8142422424180000, // 'V'
|
||||
0x4141495563410000, // 'W'
|
||||
0x4224181824420000, // 'X'
|
||||
0x4122140808080000, // 'Y'
|
||||
0x7E040810207E0000, // 'Z'
|
||||
0x3820202020380000, // '['
|
||||
0x4020100804020000, // '\'
|
||||
0x3808080808380000, // ']'
|
||||
0x1028000000000000, // '^'
|
||||
0x00000000007E0000, // '_'
|
||||
|
||||
0x1008000000000000, // '`'
|
||||
0x003C023E463A0000, // 'a'
|
||||
0x40407C42625C0000, // 'b'
|
||||
0x00001C20201C0000, // 'c'
|
||||
0x02023E42463A0000, // 'd'
|
||||
0x003C427E403C0000, // 'e'
|
||||
0x0018103810100000, // 'f'
|
||||
0x0000344C44340438, // 'g'
|
||||
0x2020382424240000, // 'h'
|
||||
0x0800080808080000, // 'i'
|
||||
0x0800180808080870, // 'j'
|
||||
0x20202428302C0000, // 'k'
|
||||
0x1010101010180000, // 'l'
|
||||
0x0000665A42420000, // 'm'
|
||||
0x00002E3222220000, // 'n'
|
||||
0x00003C42423C0000, // 'o'
|
||||
|
||||
0x00005C62427C4040, // 'p'
|
||||
0x00003A46423E0202, // 'q'
|
||||
0x00002C3220200000, // 'r'
|
||||
0x001C201804380000, // 's'
|
||||
0x00103C1010180000, // 't'
|
||||
0x00002222261A0000, // 'u'
|
||||
0x0000424224180000, // 'v'
|
||||
0x000081815A660000, // 'w'
|
||||
0x0000422418660000, // 'x'
|
||||
0x0000422214081060, // 'y'
|
||||
0x00003C08103C0000, // 'z'
|
||||
0x1C103030101C0000, // '{'
|
||||
0x0808080808080800, // '|'
|
||||
0x38080C0C08380000, // '}'
|
||||
0x000000324C000000, // '~'
|
||||
0x7E7E7E7E7E7E0000 // 'DEL'
|
||||
};
|
||||
*/
|
||||
|
||||
const uint8_t gFont6x8[96][6] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x07, 0x00, 0x07, 0x00, 0x00 },
|
||||
{ 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00 },
|
||||
{ 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00 },
|
||||
{ 0x23, 0x13, 0x08, 0x64, 0x62, 0x00 },
|
||||
{ 0x36, 0x49, 0x56, 0x20, 0x50, 0x00 },
|
||||
{ 0x00, 0x08, 0x07, 0x03, 0x00, 0x00 },
|
||||
{ 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00 },
|
||||
{ 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00 },
|
||||
{ 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00 },
|
||||
{ 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00 },
|
||||
{ 0x00, 0x80, 0x70, 0x30, 0x00, 0x00 },
|
||||
{ 0x08, 0x08, 0x08, 0x08, 0x08, 0x00 },
|
||||
{ 0x00, 0x00, 0x60, 0x60, 0x00, 0x00 },
|
||||
{ 0x20, 0x10, 0x08, 0x04, 0x02, 0x00 },
|
||||
|
||||
//{ 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00 },
|
||||
{ 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00 },
|
||||
{ 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00 },
|
||||
{ 0x72, 0x49, 0x49, 0x49, 0x46, 0x00 },
|
||||
{ 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00 },
|
||||
{ 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00 },
|
||||
{ 0x27, 0x45, 0x45, 0x45, 0x39, 0x00 },
|
||||
{ 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00 },
|
||||
{ 0x41, 0x21, 0x11, 0x09, 0x07, 0x00 },
|
||||
{ 0x36, 0x49, 0x49, 0x49, 0x36, 0x00 },
|
||||
{ 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00 },
|
||||
{ 0x00, 0x00, 0x14, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x40, 0x34, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x08, 0x14, 0x22, 0x41, 0x00 },
|
||||
{ 0x14, 0x14, 0x14, 0x14, 0x14, 0x00 },
|
||||
{ 0x00, 0x41, 0x22, 0x14, 0x08, 0x00 },
|
||||
{ 0x02, 0x01, 0x59, 0x09, 0x06, 0x00 },
|
||||
|
||||
{ 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00 },
|
||||
{ 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00 },
|
||||
{ 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00 },
|
||||
{ 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00 },
|
||||
{ 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00 },
|
||||
{ 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00 },
|
||||
{ 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00 },
|
||||
{ 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00 },
|
||||
{ 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00 },
|
||||
{ 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00 },
|
||||
{ 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00 },
|
||||
{ 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00 },
|
||||
{ 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00 },
|
||||
{ 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00 },
|
||||
{ 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00 },
|
||||
{ 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00 },
|
||||
|
||||
{ 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00 },
|
||||
{ 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00 },
|
||||
{ 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00 },
|
||||
{ 0x26, 0x49, 0x49, 0x49, 0x32, 0x00 },
|
||||
{ 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00 },
|
||||
{ 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00 },
|
||||
{ 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00 },
|
||||
{ 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00 },
|
||||
{ 0x63, 0x14, 0x08, 0x14, 0x63, 0x00 },
|
||||
{ 0x03, 0x04, 0x78, 0x04, 0x03, 0x00 },
|
||||
{ 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00 },
|
||||
{ 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00 },
|
||||
{ 0x02, 0x04, 0x08, 0x10, 0x20, 0x00 },
|
||||
{ 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00 },
|
||||
{ 0x04, 0x02, 0x01, 0x02, 0x04, 0x00 },
|
||||
{ 0x40, 0x40, 0x40, 0x40, 0x40, 0x00 },
|
||||
|
||||
{ 0x00, 0x03, 0x07, 0x08, 0x00, 0x00 },
|
||||
{ 0x20, 0x54, 0x54, 0x78, 0x40, 0x00 },
|
||||
{ 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00 },
|
||||
{ 0x38, 0x44, 0x44, 0x44, 0x28, 0x00 },
|
||||
{ 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00 },
|
||||
{ 0x38, 0x54, 0x54, 0x54, 0x18, 0x00 },
|
||||
{ 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00 },
|
||||
{ 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00 },
|
||||
{ 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00 },
|
||||
{ 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00 },
|
||||
{ 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00 },
|
||||
{ 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00 },
|
||||
{ 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00 },
|
||||
{ 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00 },
|
||||
{ 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00 },
|
||||
{ 0x38, 0x44, 0x44, 0x44, 0x38, 0x00 },
|
||||
|
||||
{ 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00 },
|
||||
{ 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00 },
|
||||
{ 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00 },
|
||||
{ 0x48, 0x54, 0x54, 0x54, 0x24, 0x00 },
|
||||
{ 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00 },
|
||||
{ 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00 },
|
||||
{ 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00 },
|
||||
{ 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00 },
|
||||
{ 0x44, 0x28, 0x10, 0x28, 0x44, 0x00 },
|
||||
{ 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00 },
|
||||
{ 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00 },
|
||||
{ 0x00, 0x08, 0x36, 0x41, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x77, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x41, 0x36, 0x08, 0x00, 0x00 },
|
||||
{ 0x02, 0x01, 0x02, 0x04, 0x02, 0x00 },
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
|
||||
};
|
||||
/*
|
||||
// ASCII 5x7 font
|
||||
const uint8_t gFont5x7[5 * 16 * 6] =
|
||||
{
|
||||
@ -248,3 +460,4 @@ const uint8_t gFont5x7[5 * 16 * 6] =
|
||||
0x02, 0x01, 0x02, 0x04, 0x02,
|
||||
0x3C, 0x26, 0x23, 0x26, 0x3C
|
||||
};
|
||||
*/
|
10
font.h
10
font.h
@ -19,11 +19,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern const uint8_t gFontBig[95][16];
|
||||
extern const uint8_t gFontBigDigits[11][26];
|
||||
extern const uint8_t gFontSmallDigits[11][7];
|
||||
extern const uint8_t gFontBig[95][16];
|
||||
extern const uint8_t gFontBigDigits[11][26];
|
||||
extern const uint8_t gFontSmallDigits[11][7];
|
||||
|
||||
extern const uint8_t gFont5x7[5 * 16 * 6];
|
||||
//extern const uint64_t gFont8x8[16 * 6];
|
||||
extern const uint8_t gFont6x8[96][6];
|
||||
//extern const uint8_t gFont5x7[5 * 16 * 6];
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -98,7 +98,8 @@ typedef enum ROGER_Mode_t ROGER_Mode_t;
|
||||
enum CHANNEL_DisplayMode_t {
|
||||
MDF_FREQUENCY = 0,
|
||||
MDF_CHANNEL,
|
||||
MDF_NAME
|
||||
MDF_NAME,
|
||||
MDF_NAME_FREQ
|
||||
};
|
||||
|
||||
typedef enum CHANNEL_DisplayMode_t CHANNEL_DisplayMode_t;
|
||||
|
53
ui/helper.c
53
ui/helper.c
@ -22,6 +22,10 @@
|
||||
#include "ui/helper.h"
|
||||
#include "ui/inputbox.h"
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof((arr)[0]))
|
||||
#endif
|
||||
|
||||
void UI_GenerateChannelString(char *pString, const uint8_t Channel)
|
||||
{
|
||||
unsigned int i;
|
||||
@ -86,18 +90,53 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_
|
||||
if (bCentered)
|
||||
Start += (((End - Start) - (Length * 8)) + 1) / 2;
|
||||
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
if (pString[i] >= 32)
|
||||
#if 0
|
||||
{ // 5x7 font
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
const unsigned int Index = ((unsigned int)pString[i] - 32) * 5;
|
||||
if (Index < sizeof(gFont5x7))
|
||||
if (pString[i] >= 32)
|
||||
{
|
||||
const unsigned int ofs = (unsigned int)Start + (i * 8);
|
||||
memcpy(gFrameBuffer[Line] + ofs, &gFont5x7[Index], 5);
|
||||
const unsigned int Index = ((unsigned int)pString[i] - 32) * 5;
|
||||
if (Index < sizeof(gFont5x7))
|
||||
{
|
||||
const unsigned int ofs = (unsigned int)Start + (i * 8);
|
||||
memcpy(gFrameBuffer[Line] + ofs, &gFont5x7[Index], 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
{ // 6x8 font
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
if (pString[i] >= 32)
|
||||
{
|
||||
const unsigned int Index = (unsigned int)pString[i] - 32;
|
||||
if (Index < ARRAY_SIZE(gFont6x8))
|
||||
{
|
||||
const unsigned int ofs = (unsigned int)Start + (i * 8);
|
||||
memcpy(gFrameBuffer[Line] + ofs, &gFont6x8[Index], 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
{ // 8x8 font
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
if (pString[i] >= 32)
|
||||
{
|
||||
const unsigned int Index = (unsigned int)pString[i] - 32;
|
||||
if (Index < ARRAY_SIZE(gFont8x8))
|
||||
{
|
||||
const unsigned int ofs = (unsigned int)Start + (i * 8);
|
||||
memcpy(gFrameBuffer[Line] + ofs, &gFont8x8[Index], 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
void UI_DisplayFrequency(const char *pDigits, uint8_t X, uint8_t Y, bool bDisplayLeadingZero, bool bFlag)
|
||||
|
38
ui/main.c
38
ui/main.c
@ -288,20 +288,28 @@ void UI_DisplayMain(void)
|
||||
UI_DisplaySmallDigits(2, String + 6, 112, Line + 1);
|
||||
|
||||
frequency_Hz = 0;
|
||||
|
||||
break;
|
||||
|
||||
case MDF_CHANNEL:
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
#ifdef CHAN_NAME_FREQ
|
||||
UI_PrintStringSmall(String, 31 + 8, 0, (vfo_num * 4) + 1, false);
|
||||
#else
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
#endif
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
frequency_Hz = 0;
|
||||
break;
|
||||
|
||||
case MDF_NAME:
|
||||
#ifdef CHAN_NAME_FREQ
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] == 0 || gEeprom.VfoInfo[vfo_num].Name[0] == 0xFF)
|
||||
{ // channel number
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
}
|
||||
else
|
||||
{ // channel name
|
||||
UI_PrintString(gEeprom.VfoInfo[vfo_num].Name, 31, 112, vfo_num * 4, 8, true);
|
||||
}
|
||||
frequency_Hz = 0;
|
||||
break;
|
||||
|
||||
#ifdef CHAN_NAME_FREQ
|
||||
case MDF_NAME_FREQ:
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] == 0 || gEeprom.VfoInfo[vfo_num].Name[0] == 0xFF)
|
||||
{ // channel number
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
@ -313,18 +321,8 @@ void UI_DisplayMain(void)
|
||||
memcpy(String, gEeprom.VfoInfo[vfo_num].Name, 8);
|
||||
UI_PrintStringSmall(gEeprom.VfoInfo[vfo_num].Name, 31 + 8, 0, (vfo_num * 4) + 1, false);
|
||||
}
|
||||
#else
|
||||
if (gEeprom.VfoInfo[vfo_num].Name[0] == 0 || gEeprom.VfoInfo[vfo_num].Name[0] == 0xFF)
|
||||
{ // channel number
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
UI_PrintString(String, 31, 112, vfo_num * 4, 8, true);
|
||||
}
|
||||
else
|
||||
{ // channel name
|
||||
UI_PrintString(gEeprom.VfoInfo[vfo_num].Name, 31, 112, vfo_num * 4, 8, true);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
22
ui/menu.c
22
ui/menu.c
@ -183,12 +183,22 @@ static const char gSubMenu_SC_REV[3][3] =
|
||||
"SE",
|
||||
};
|
||||
|
||||
static const char gSubMenu_MDF[3][5] =
|
||||
{
|
||||
"FREQ",
|
||||
"CHAN",
|
||||
"NAME",
|
||||
};
|
||||
#ifndef CHAN_NAME_FREQ
|
||||
static const char gSubMenu_MDF[3][5] =
|
||||
{
|
||||
"FREQ",
|
||||
"CHAN",
|
||||
"NAME"
|
||||
};
|
||||
#else
|
||||
static const char gSubMenu_MDF[4][8] =
|
||||
{
|
||||
"FREQ",
|
||||
"CHAN",
|
||||
"NAME",
|
||||
"NAM+FRE"
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_ALARM
|
||||
static const char gSubMenu_AL_MOD[2][5] =
|
||||
|
11
ui/rssi.c
11
ui/rssi.c
@ -74,10 +74,13 @@ void UI_UpdateRSSI(uint16_t RSSI)
|
||||
{
|
||||
//const int16_t dB = (int16_t)(RSSI / 2) - 160;
|
||||
|
||||
const uint16_t level0 = gEEPROM_RSSI_CALIB[gRxVfo->Band][0];
|
||||
const uint16_t level1 = gEEPROM_RSSI_CALIB[gRxVfo->Band][1];
|
||||
const uint16_t level2 = gEEPROM_RSSI_CALIB[gRxVfo->Band][2];
|
||||
const uint16_t level3 = gEEPROM_RSSI_CALIB[gRxVfo->Band][3];
|
||||
// const unsigned int band = gRxVfo->Band;
|
||||
const unsigned int band = 0;
|
||||
|
||||
const uint16_t level0 = gEEPROM_RSSI_CALIB[band][0];
|
||||
const uint16_t level1 = gEEPROM_RSSI_CALIB[band][1];
|
||||
const uint16_t level2 = gEEPROM_RSSI_CALIB[band][2];
|
||||
const uint16_t level3 = gEEPROM_RSSI_CALIB[band][3];
|
||||
const uint16_t level01 = (level0 + level1) / 2;
|
||||
const uint16_t level12 = (level1 + level2) / 2;
|
||||
const uint16_t level23 = (level2 + level3) / 2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user